add broken latin encoding to test file
[gitweb.git] / gitweb.cgi
index afdae92e1f0fc07bab5bcec3a558b88e1d2a8821..dc4435c090779260ab900cc00d9522cdb77043d9 100755 (executable)
@@ -14,9 +14,10 @@ use CGI::Util qw(unescape);
 use CGI::Carp qw(fatalsToBrowser);
 use Encode;
 use Fcntl ':mode';
+binmode STDOUT, ':utf8';
 
 my $cgi = new CGI;
-my $version =          "250";
+my $version =          "253";
 my $my_url =           $cgi->url();
 my $my_uri =           $cgi->url(-absolute => 1);
 my $rss_link =         "";
@@ -217,8 +218,8 @@ sub esc_url {
 
 sub esc_html {
        my $str = shift;
-       $str = escapeHTML($str);
        $str = decode("utf8", $str, Encode::FB_DEFAULT);
+       $str = escapeHTML($str);
        return $str;
 }
 
@@ -1810,7 +1811,7 @@ sub git_commit {
                              $cgi->a({-href => esc_url("$my_uri?p=$project;a=blob;h=$from_id;hb=$hash;f=$from_file"), -class => "list"}, esc_html($from_file)) .
                              " with " . (int $similarity) . "% similarity$mode_chng]</span></td>\n" .
                              "<td class=\"link\">" .
-                             $cgi->a({-href => esc_uresc_url("$my_uri?p=$project;a=blob;h=$to_id;hb=$hash;f=$to_file")}, "blob");
+                             $cgi->a({-href => esc_url("$my_uri?p=$project;a=blob;h=$to_id;hb=$hash;f=$to_file")}, "blob");
                        if ($to_id ne $from_id) {
                                print " | " . $cgi->a({-href => esc_url("$my_uri?p=$project;a=blobdiff;h=$to_id;hp=$from_id;hb=$hash;f=$to_file")}, "diff");
                        }