git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] t8005: use more portable character encoding names
@ 2009-05-22 15:25 Brandon Casey
  2009-05-22 16:22 ` Junio C Hamano
  0 siblings, 1 reply; 15+ messages in thread
From: Brandon Casey @ 2009-05-22 15:25 UTC (permalink / raw)
  To: gitster; +Cc: git

Some platforms do not have an extensive list of alternate names for
character encodings.

On IRIX 6.5 cp1251 is unknown, but WIN1251 (which seems to be a
non-standard name) is known.  On Solaris 10, the opposite is true.  Solaris
also knows cp1251 as WINDOWS-1251, but this too is not recognized on IRIX.
I could not find a name that both platforms recognized for this character
set.

Solaris 7 does not know about shift-jis, but does know SJIS.  It also does
not know that utf-8 and UTF-8 refer to the same encoding.

With the above in mind, and the impression that upper-case code names are
more portable than lower-case, the following conversions were performed:

      utf-8 --> UTF-8
     cp1251 --> CP1251
  shift-jis --> SJIS

The UTF-8 and SJIS conversions allow 2 of the 3 elements of test 4 to succeed
on Solaris 7, but alas, my Solaris 7 does not have CP1251.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---


Here's another patch in an attempt to make the character encoding names
more portable.  I hesitate to send it since it does not actually allow any
tests to pass which were previously failing for me.  At least the utf-8 to
UTF-8 shouldn't cause any harm.  The shift-jis to SJIS seems to be commonly
supported?  at least IRIX 6.5 and Solaris as old as 7 recognize it, but the
evidence is only empirical.  Modern Solaris, and of course Linux recognize
either.

-brandon


 t/t8005-blame-i18n.sh |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/t/t8005-blame-i18n.sh b/t/t8005-blame-i18n.sh
index fcd5c26..9c930a5 100755
--- a/t/t8005-blame-i18n.sh
+++ b/t/t8005-blame-i18n.sh
@@ -15,12 +15,12 @@ test_expect_success 'setup the repository' '
 
 	echo "CP1251 LINE" >> file &&
 	git add file &&
-	git config i18n.commitencoding cp1251 &&
+	git config i18n.commitencoding CP1251 &&
 	git commit --author "$CP1251_NAME <cp1251@localhost>" -m "$CP1251_MSG" &&
 
 	echo "SJIS LINE" >> file &&
 	git add file &&
-	git config i18n.commitencoding shift-jis &&
+	git config i18n.commitencoding SJIS &&
 	git commit --author "$SJIS_NAME <sjis@localhost>" -m "$SJIS_MSG"
 '
 
@@ -51,7 +51,7 @@ EOF
 
 test_expect_success \
 	'blame respects i18n.logoutputencoding' '
-	git config i18n.logoutputencoding cp1251 &&
+	git config i18n.logoutputencoding CP1251 &&
 	git blame --incremental file | \
 		egrep "^(author|summary) " > actual &&
 	test_cmp actual expected
@@ -67,8 +67,8 @@ summary $UTF8_MSG
 EOF
 
 test_expect_success \
-	'blame respects --encoding=utf-8' '
-	git blame --incremental --encoding=utf-8 file | \
+	'blame respects --encoding=UTF-8' '
+	git blame --incremental --encoding=UTF-8 file | \
 		egrep "^(author|summary) " > actual &&
 	test_cmp actual expected
 '
-- 
1.6.3.1.24.g152f4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2009-05-28 18:48 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-22 15:25 [PATCH] t8005: use more portable character encoding names Brandon Casey
2009-05-22 16:22 ` Junio C Hamano
2009-05-22 16:51   ` Brandon Casey
2009-05-22 23:04   ` Alex Riesen
2009-05-22 23:47   ` [PATCH 1/2] " Brandon Casey
2009-05-22 23:47     ` [PATCH 2/2] t8005: convert CP1251 character set to ISO8859-5 Brandon Casey
2009-05-23  1:02       ` Junio C Hamano
2009-05-23  1:06         ` Junio C Hamano
2009-05-25  9:20           ` Jeff King
2009-05-25  9:26             ` Jeff King
2009-05-26 14:56             ` Brandon Casey
2009-05-28 18:43               ` Jeff King
2009-05-26 14:57             ` Brandon Casey
2009-05-28 18:47               ` Jeff King
2009-05-26 22:56             ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).