]> git.ipfire.org Git - thirdparty/git.git/commit - pretty.c
pretty: two phase conversion for non utf-8 commits
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Thu, 18 Apr 2013 23:08:47 +0000 (09:08 +1000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 18 Apr 2013 23:28:28 +0000 (16:28 -0700)
commit7e77df39bf20f04b266f394a64c2fca54c1e5db0
tree1209774988aeb0179e7431b22b4713f0abe830f2
parentb782bbab94e3618aea352907caa77321b487b918
pretty: two phase conversion for non utf-8 commits

Always assume format_commit_item() takes an utf-8 string for string
handling simplicity (we can handle utf-8 strings, but can't with other
encodings).

If commit message is in non-utf8, or output encoding is not, then the
commit is first converted to utf-8, processed, then output converted
to output encoding. This of course only works with encodings that are
compatible with Unicode.

This also fixes the iso8859-1 test in t6006. It's supposed to create
an iso8859-1 commit, but the commit content in t6006 is in UTF-8.
t6006 is now converted back in UTF-8 (the downside is we can't put
utf-8 strings there anymore).

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pretty.c
t/t6006-rev-list-format.sh