Browse Source

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
maint
Junio C Hamano 9 years ago
parent
commit
13af774e26
  1. 3
      gitweb/gitweb.perl

3
gitweb/gitweb.perl

@ -3935,6 +3935,9 @@ sub run_highlighter { @@ -3935,6 +3935,9 @@ sub run_highlighter {

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");

Loading…
Cancel
Save