diff options
author | Shin Kojima <shin@kojima.org> | 2016-05-03 22:00:51 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-05-03 11:32:31 -0700 |
commit | 029f37217c01fc6437357a30cd1b084b03ca872b (patch) | |
tree | a9216c3b89921eedf841ffed1b5eed26184969a5 /pack-bitmap.c | |
parent | Git 2.4.11 (diff) | |
download | tgif-029f37217c01fc6437357a30cd1b084b03ca872b.tar.xz |
gitweb: apply fallback encoding before highlight
Some multi-byte character encodings (such as Shift_JIS and GBK) have
characters whose final bytes is an ASCII '\' (0x5c), and they
will be displayed as funny-characters even if $fallback_encoding is
correct. This is because `highlight` command always expects UTF-8
encoded strings from STDIN.
$ echo 'my $v = "申";' | highlight --syntax perl | w3m -T text/html -dump
my $v = "申";
$ echo 'my $v = "申";' | iconv -f UTF-8 -t Shift_JIS | highlight \
--syntax perl | iconv -f Shift_JIS -t UTF-8 | w3m -T text/html -dump
iconv: (stdin):9:135: cannot convert
my $v = "
This patch prepare git blob objects to be encoded into UTF-8 before
highlighting in the manner of `to_utf8` subroutine.
Signed-off-by: Shin Kojima <shin@kojima.org>
Reviewed-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-bitmap.c')
0 files changed, 0 insertions, 0 deletions