]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.perl
gitweb: apply fallback encoding before highlight
[Gitweb] / gitweb.perl
index 40730e11d815b9c4291ab516ee0bc24e43eac2b6a3d285a2c8360593b37c2e52..c19148234ff7ae0956589878b7c0755d53399961a72f4daf712bffd18e4555e6 100755 (executable)
@@ -3936,6 +3936,9 @@ sub run_highlighter {
 
        close $fd;
        open $fd, quote_command(git_cmd(), "cat-file", "blob", $hash)." | ".
 
        close $fd;
        open $fd, quote_command(git_cmd(), "cat-file", "blob", $hash)." | ".
+                 quote_command($^X, '-CO', '-MEncode=decode,FB_DEFAULT', '-pse',
+                   '$_ = decode($fe, $_, FB_DEFAULT) if !utf8::decode($_);',
+                   '--', "-fe=$fallback_encoding")." | ".
                  quote_command($highlight_bin).
                  " --replace-tabs=8 --fragment --syntax $syntax |"
                or die_error(500, "Couldn't open file or run syntax highlighter");
                  quote_command($highlight_bin).
                  " --replace-tabs=8 --fragment --syntax $syntax |"
                or die_error(500, "Couldn't open file or run syntax highlighter");
This page took 0.18042 seconds and 4 git commands to generate.