Skip to content

Commit

Permalink
Merge branch 'sk/gitweb-highlight-encoding' into HEAD
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gitster committed May 18, 2016
2 parents 0968758 + 029f372 commit 13af774
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gitweb/gitweb.perl
Expand Up @@ -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");
Expand Down

0 comments on commit 13af774

Please sign in to comment.