diff options
author | Martin Koegler <mkoegler@auto.tuwien.ac.at> | 2007-06-03 17:42:44 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-06-03 16:51:53 -0700 |
commit | 00f429af7bfaa6a9141bc0ac30995d4fae24836a (patch) | |
tree | 3b19bf38164896eb6d2ca8f1199b647e4331dbf0 /t/t9500-gitweb-standalone-no-errors.sh | |
parent | Add test-sha1 to .gitignore. (diff) | |
download | tgif-00f429af7bfaa6a9141bc0ac30995d4fae24836a.tar.xz |
gitweb: Handle non UTF-8 text better
gitweb assumes that everything is in UTF-8. If a text contains invalid
UTF-8 character sequences, the text must be in a different encoding.
This commit introduces $fallback_encoding which would be used as input
encoding if gitweb encounters text with is not valid UTF-8.
Add basic test for this in t/t9500-gitweb-standalone-no-errors.sh
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Tested-by: Alexandre Julliard <julliard@winehq.org>
Tested-by: Ismail Dönmez <ismail@pardus.org.tr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9500-gitweb-standalone-no-errors.sh')
-rwxr-xr-x | t/t9500-gitweb-standalone-no-errors.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh index b92ab63312..44ae503b99 100755 --- a/t/t9500-gitweb-standalone-no-errors.sh +++ b/t/t9500-gitweb-standalone-no-errors.sh @@ -487,4 +487,32 @@ test_expect_success \ 'gitweb_run "p=.git;a=atom"' test_debug 'cat gitweb.log' +# ---------------------------------------------------------------------- +# encoding/decoding + +test_expect_success \ + 'encode(commit): utf8' \ + '. ../t3901-utf8.txt && + echo "UTF-8" >> file && + git add file && + git commit -F ../t3900/1-UTF-8.txt && + gitweb_run "p=.git;a=commit"' +test_debug 'cat gitweb.log' + +test_expect_success \ + 'encode(commit): iso-8859-1' \ + '. ../t3901-8859-1.txt && + echo "ISO-8859-1" >> file && + git add file && + git config i18n.commitencoding ISO-8859-1 && + git commit -F ../t3900/ISO-8859-1.txt && + git config --unset i18n.commitencoding && + gitweb_run "p=.git;a=commit"' +test_debug 'cat gitweb.log' + +test_expect_success \ + 'encode(log): utf-8 and iso-8859-1' \ + 'gitweb_run "p=.git;a=log"' +test_debug 'cat gitweb.log' + test_done |