aboutsummaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-05-10 13:40:33 -0700
committerJunio C Hamano <gitster@pobox.com>2016-05-10 13:40:33 -0700
commit04bd6da2dc9c12f5bff29bc81c037891ef7ed230 (patch)
tree1c4d413d24041649f5d53e7c01172faa35960b04 /gitweb
parentc5d782bef541980c2db022a44816aac2f51b991c (diff)
parent029f37217c01fc6437357a30cd1b084b03ca872b (diff)
downloadgit-04bd6da2dc9c12f5bff29bc81c037891ef7ed230.tar.gz
git-04bd6da2dc9c12f5bff29bc81c037891ef7ed230.tar.xz
Merge branch 'sk/gitweb-highlight-encoding'
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
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl3
1 files changed, 3 insertions, 0 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 05d7910b7..2fddf750f 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");