Skip to content

Commit 13af774

Browse files
committed
Merge branch 'sk/gitweb-highlight-encoding' into HEAD
Some multi-byte encoding can have a backslash byte as a later part of one letter, which would confuse "highlight" filter used in gitweb. * sk/gitweb-highlight-encoding: gitweb: apply fallback encoding before highlight
2 parents 0968758 + 029f372 commit 13af774

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

gitweb/gitweb.perl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3935,6 +3935,9 @@ sub run_highlighter {
39353935

39363936
close $fd;
39373937
open $fd, quote_command(git_cmd(), "cat-file", "blob", $hash)." | ".
3938+
quote_command($^X, '-CO', '-MEncode=decode,FB_DEFAULT', '-pse',
3939+
'$_ = decode($fe, $_, FB_DEFAULT) if !utf8::decode($_);',
3940+
'--', "-fe=$fallback_encoding")." | ".
39383941
quote_command($highlight_bin).
39393942
" --replace-tabs=8 --fragment --syntax $syntax |"
39403943
or die_error(500, "Couldn't open file or run syntax highlighter");

0 commit comments

Comments
 (0)