Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'sk/gitweb-highlight-encoding' into HEAD
author
Junio C Hamano
<gitster@pobox.com>
Wed, 18 May 2016 21:40:10 +0000
(14:40 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 18 May 2016 21:40:10 +0000
(14:40 -0700)
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
gitweb/gitweb.perl
patch
|
blob
|
history
raw
(from parent 1:
0968758
)
diff --git
a/gitweb/gitweb.perl
b/gitweb/gitweb.perl
index 05d7910b7cdbd6fea7c835491caa774a46e4b7f8..2fddf750fabf9ac2d079777ad7bd7953c2477f9c 100755
(executable)
--- 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");