summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-05-18 21:40:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-05-18 21:40:10 (GMT)
commit13af774e263341eecdd67e6ca28ecc47d7997152 (patch)
treeddc11e38a891d31f9387491755610ac11741db83
parent09687585d1409754629b4b4c66f5089f0680500b (diff)
parent029f37217c01fc6437357a30cd1b084b03ca872b (diff)
downloadgit-13af774e263341eecdd67e6ca28ecc47d7997152.zip
git-13af774e263341eecdd67e6ca28ecc47d7997152.tar.gz
git-13af774e263341eecdd67e6ca28ecc47d7997152.tar.bz2
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
-rwxr-xr-xgitweb/gitweb.perl3
1 files changed, 3 insertions, 0 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 05d7910..2fddf75 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -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");