threads / patch / 19409

patch, 8 partsbuiltin-mailinfo.c: compare character encodings case insensitively

Subject: [PATCH 3/8] builtin-mailinfo.c: compare character encodings case insensitively

## tl;dr

9 messages between May 18, 2009 and May 18, 2009. Diffs are folded; open one to read it.

replies: 8people: 1as markdown or json

Brandon Casey· May 18, 2009, 23:44 UTC · lore

[PATCH 0/8] character encoding portability updates

I got a clue from Alex Riesen's "Use UTF-8 instead of utf8 for backward compatibility" commit 39d404d1 that some of the iconv issues on Solaris and IRIX could be caused by character code naming issues. It seems that these platforms do not understand all of the alternate names that modern platforms do.

Character encodings are not a strong point of mine, so do comment if you see something wrong.

In particular, notice 4/8 that changes the default fallback encoding to ISO8859-1 instead of latin1. My understanding is that these two are equivalent.

With this series applied, Solaris 10 must skip only 4 tests for me (plus two more if I use Korn shell). The remaining ones that are skipped have to do with iconv but the character code conversions being tested are not installed.

Solaris 7 must skip 30 (32 with Korn shell), down from 52 (54), and IRIX 6.5 must skip only 13, down from 44.

-brandon
Brandon Casey (8):
  t3900: use ancient iconv names for backward compatibility
  Use 'UTF-8' rather than 'utf-8' everywhere for backward compatibility
  builtin-mailinfo.c: compare character encodings case insensitively
  builtin-mailinfo.c: use "ISO8859-1" instead of "latin1" as fallback
    encoding
  t3901: avoid negation on right hand side of '|'
  t3901: Use ISO8859-1 instead of ISO-8859-1 for backward compatibility
  t9301: use ISO8859-1 rather than ISO-8859-1
  t5100: use ancient encoding syntax for backwards compatibility
 builtin-log.c                             |    2 +-
 builtin-mailinfo.c                        |   10 +++----
 builtin-revert.c                          |    4 +-
 pretty.c                                  |    4 +-
 t/t3900-i18n-commit.sh                    |   28 ++++++++++----------
 t/t3900/{ISO-8859-1.txt => ISO8859-1.txt} |    0
 t/t3900/{EUCJP.txt => eucJP.txt}          |    0
 t/t3901-i18n-patch.sh                     |   40 ++++++++++++++--------------
 t/t5100/rfc2047-samples.mbox              |   32 +++++++++++-----------
 t/t5100/sample.mbox                       |    8 +++---
 t/t9129-git-svn-i18n-commitencoding.sh    |   10 +++---
 t/t9301-fast-export.sh                    |    2 +-
 t/t9500-gitweb-standalone-no-errors.sh    |    2 +-
 13 files changed, 70 insertions(+), 72 deletions(-)
 rename t/t3900/{ISO-8859-1.txt => ISO8859-1.txt} (100%)
 rename t/t3900/{EUCJP.txt => eucJP.txt} (100%)
Brandon Casey· May 18, 2009, 23:44 UTC · re: Brandon Casey · lore

[PATCH 1/8] t3900: use ancient iconv names for backward compatibility

Some old iconv implementations do not have many alternate names and/or do not match character encoding names case insensitively. These implementations can not tell that utf-8 and UTF-8 are the same encoding and fail when trying to do the conversion. So use the old names, which modern implementations still support.

The following conversions were performed:
         utf-8 --> UTF-8
    ISO-8859-1 --> ISO8859-1
         EUCJP --> eucJP
Also update t9129 and t9500 which make use of the test files in t/t3900.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 t/t3900-i18n-commit.sh                    |   28 ++++++++++++++--------------
 t/t3900/{ISO-8859-1.txt => ISO8859-1.txt} |    0
 t/t3900/{EUCJP.txt => eucJP.txt}          |    0
 t/t9129-git-svn-i18n-commitencoding.sh    |   10 +++++-----
 t/t9500-gitweb-standalone-no-errors.sh    |    2 +-
 5 files changed, 20 insertions(+), 20 deletions(-)
 rename t/t3900/{ISO-8859-1.txt => ISO8859-1.txt} (100%)
 rename t/t3900/{EUCJP.txt => eucJP.txt} (100%)
Show changes to 5 files +20 −20

t/t3900-i18n-commit.sh, t/t3900/ISO-8859-1.txt, t/t3900/EUCJP.txt, t/t9129-git-svn-i18n-commitencoding.sh, t/t9500-gitweb-standalone-no-errors.sh

diff --git a/t/t3900-i18n-commit.sh b/t/t3900-i18n-commit.sh
index b4ec2b5..256c4c9 100755
--- a/t/t3900-i18n-commit.sh
+++ b/t/t3900-i18n-commit.sh
@@ -34,7 +34,7 @@ test_expect_success 'no encoding header for base case' '
 	test z = "z$E"
 '
 
-for H in ISO-8859-1 EUCJP ISO-2022-JP
+for H in ISO8859-1 eucJP ISO-2022-JP
 do
 	test_expect_success "$H setup" '
 		git config i18n.commitencoding $H &&
@@ -44,7 +44,7 @@ do
 	'
 done
 
-for H in ISO-8859-1 EUCJP ISO-2022-JP
+for H in ISO8859-1 eucJP ISO-2022-JP
 do
 	test_expect_success "check encoding header for $H" '
 		E=$(git cat-file commit '$H' | sed -ne "s/^encoding //p") &&
@@ -61,14 +61,14 @@ test_expect_success 'config to remove customization' '
 	else
 		test z = "z$Z"
 	fi &&
-	git config i18n.commitencoding utf-8
+	git config i18n.commitencoding UTF-8
 '
 
-test_expect_success 'ISO-8859-1 should be shown in UTF-8 now' '
-	compare_with ISO-8859-1 "$TEST_DIRECTORY"/t3900/1-UTF-8.txt
+test_expect_success 'ISO8859-1 should be shown in UTF-8 now' '
+	compare_with ISO8859-1 "$TEST_DIRECTORY"/t3900/1-UTF-8.txt
 '
 
-for H in EUCJP ISO-2022-JP
+for H in eucJP ISO-2022-JP
 do
 	test_expect_success "$H should be shown in UTF-8 now" '
 		compare_with '$H' "$TEST_DIRECTORY"/t3900/2-UTF-8.txt
@@ -86,7 +86,7 @@ test_expect_success 'config to add customization' '
 	fi
 '
 
-for H in ISO-8859-1 EUCJP ISO-2022-JP
+for H in ISO8859-1 eucJP ISO-2022-JP
 do
 	test_expect_success "$H should be shown in itself now" '
 		git config i18n.commitencoding '$H' &&
@@ -95,21 +95,21 @@ do
 done
 
 test_expect_success 'config to tweak customization' '
-	git config i18n.logoutputencoding utf-8
+	git config i18n.logoutputencoding UTF-8
 '
 
-test_expect_success 'ISO-8859-1 should be shown in UTF-8 now' '
-	compare_with ISO-8859-1 "$TEST_DIRECTORY"/t3900/1-UTF-8.txt
+test_expect_success 'ISO8859-1 should be shown in UTF-8 now' '
+	compare_with ISO8859-1 "$TEST_DIRECTORY"/t3900/1-UTF-8.txt
 '
 
-for H in EUCJP ISO-2022-JP
+for H in eucJP ISO-2022-JP
 do
 	test_expect_success "$H should be shown in UTF-8 now" '
 		compare_with '$H' "$TEST_DIRECTORY"/t3900/2-UTF-8.txt
 	'
 done
 
-for J in EUCJP ISO-2022-JP
+for J in eucJP ISO-2022-JP
 do
 	if test "$J" = ISO-2022-JP
 	then
@@ -118,7 +118,7 @@ do
 		ICONV=
 	fi
 	git config i18n.logoutputencoding $J
-	for H in EUCJP ISO-2022-JP
+	for H in eucJP ISO-2022-JP
 	do
 		test_expect_success "$H should be shown in $J now" '
 			compare_with '$H' "$TEST_DIRECTORY"/t3900/'$J'.txt $ICONV
@@ -126,7 +126,7 @@ do
 	done
 done
 
-for H in ISO-8859-1 EUCJP ISO-2022-JP
+for H in ISO8859-1 eucJP ISO-2022-JP
 do
 	test_expect_success "No conversion with $H" '
 		compare_with "--encoding=none '$H'" "$TEST_DIRECTORY"/t3900/'$H'.txt
diff --git a/t/t3900/ISO-8859-1.txt b/t/t3900/ISO8859-1.txt
similarity index 100%
rename from t/t3900/ISO-8859-1.txt
rename to t/t3900/ISO8859-1.txt
diff --git a/t/t3900/EUCJP.txt b/t/t3900/eucJP.txt
similarity index 100%
rename from t/t3900/EUCJP.txt
rename to t/t3900/eucJP.txt
diff --git a/t/t9129-git-svn-i18n-commitencoding.sh b/t/t9129-git-svn-i18n-commitencoding.sh
index 3200ab3..6c6d033 100755
--- a/t/t9129-git-svn-i18n-commitencoding.sh
+++ b/t/t9129-git-svn-i18n-commitencoding.sh
@@ -29,7 +29,7 @@ compare_svn_head_with () {
 	test_cmp current "$1"
 }
 
-for H in ISO-8859-1 EUCJP ISO-2022-JP
+for H in ISO8859-1 eucJP ISO-2022-JP
 do
 	test_expect_success "$H setup" '
 		mkdir $H &&
@@ -38,7 +38,7 @@ do
 	'
 done
 
-for H in ISO-8859-1 EUCJP ISO-2022-JP
+for H in ISO8859-1 eucJP ISO-2022-JP
 do
 	test_expect_success "$H commit on git side" '
 	(
@@ -55,7 +55,7 @@ do
 	'
 done
 
-for H in ISO-8859-1 EUCJP ISO-2022-JP
+for H in ISO8859-1 eucJP ISO-2022-JP
 do
 	test_expect_success "$H dcommit to svn" '
 	(
@@ -77,12 +77,12 @@ fi
 
 test_expect_success UTF8 'ISO-8859-1 should match UTF-8 in svn' '
 	(
-		cd ISO-8859-1 &&
+		cd ISO8859-1 &&
 		compare_svn_head_with "$TEST_DIRECTORY"/t3900/1-UTF-8.txt
 	)
 '
 
-for H in EUCJP ISO-2022-JP
+for H in eucJP ISO-2022-JP
 do
 	test_expect_success UTF8 "$H should match UTF-8 in svn" '
 		(
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index f4210fb..d539619 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -590,7 +590,7 @@ test_expect_success \
 	 echo "ISO-8859-1" >> file &&
 	 git add file &&
 	 git config i18n.commitencoding ISO-8859-1 &&
-	 git commit -F "$TEST_DIRECTORY"/t3900/ISO-8859-1.txt &&
+	 git commit -F "$TEST_DIRECTORY"/t3900/ISO8859-1.txt &&
 	 git config --unset i18n.commitencoding &&
 	 gitweb_run "p=.git;a=commit"'
 test_debug 'cat gitweb.log'
-- 
1.6.3.1.24.g152f4
Brandon Casey· May 18, 2009, 23:44 UTC · re: Brandon Casey · lore

[PATCH 2/8] Use 'UTF-8' rather than 'utf-8' everywhere for backward compatibility

Some ancient platforms (Solaris 7, IRIX 6.5) do not understand 'utf-8', but all tested implementations understand 'UTF-8'.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 builtin-log.c      |    2 +-
 builtin-mailinfo.c |    2 +-
 builtin-revert.c   |    4 ++--
 pretty.c           |    4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)
Show changes to 4 files +6 −6

builtin-log.c, builtin-mailinfo.c, builtin-revert.c, pretty.c

diff --git a/builtin-log.c b/builtin-log.c
index 5eaec5d..58db959 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -619,7 +619,7 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
 	struct shortlog log;
 	struct strbuf sb = STRBUF_INIT;
 	int i;
-	const char *encoding = "utf-8";
+	const char *encoding = "UTF-8";
 	struct diff_options opts;
 	int need_8bit_cte = 0;
 	struct commit *commit = NULL;
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index 1eeeb4d..5ebc8b5 100644
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
@@ -944,7 +944,7 @@ int cmd_mailinfo(int argc, const char **argv, const char *prefix)
 	 */
 	git_config(git_default_config, NULL);
 
-	def_charset = (git_commit_encoding ? git_commit_encoding : "utf-8");
+	def_charset = (git_commit_encoding ? git_commit_encoding : "UTF-8");
 	metainfo_charset = def_charset;
 
 	while (1 < argc && argv[1][0] == '-') {
diff --git a/builtin-revert.c b/builtin-revert.c
index 3f2614e..ae01395 100644
--- a/builtin-revert.c
+++ b/builtin-revert.c
@@ -323,9 +323,9 @@ static int revert_or_cherry_pick(int argc, const char **argv)
 
 	encoding = get_encoding(message);
 	if (!encoding)
-		encoding = "utf-8";
+		encoding = "UTF-8";
 	if (!git_commit_encoding)
-		git_commit_encoding = "utf-8";
+		git_commit_encoding = "UTF-8";
 	if ((reencoded_message = reencode_string(message,
 					git_commit_encoding, encoding)))
 		message = reencoded_message;
diff --git a/pretty.c b/pretty.c
index a0ef356..e5328da 100644
--- a/pretty.c
+++ b/pretty.c
@@ -284,7 +284,7 @@ static char *replace_encoding_header(char *buf, const char *encoding)
 static char *logmsg_reencode(const struct commit *commit,
 			     const char *output_encoding)
 {
-	static const char *utf8 = "utf-8";
+	static const char *utf8 = "UTF-8";
 	const char *use_encoding;
 	char *encoding;
 	char *out;
@@ -881,7 +881,7 @@ char *reencode_commit_message(const struct commit *commit, const char **encoding
 		    ? git_log_output_encoding
 		    : git_commit_encoding);
 	if (!encoding)
-		encoding = "utf-8";
+		encoding = "UTF-8";
 	if (encoding_p)
 		*encoding_p = encoding;
 	return logmsg_reencode(commit, encoding);
-- 
1.6.3.1.24.g152f4
Brandon Casey· May 18, 2009, 23:44 UTC · re: Brandon Casey · lore

When converting between character encodings, git tests whether the "from" encoding and the "to" encoding have the same name. git should perform this test case insensitively so that e.g. utf-8 is not seen as a different encoding than UTF-8.

Additionally, it is not necessary to call tolower() anymore on the encodings extracted from the mail message.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 builtin-mailinfo.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
Show changes to builtin-mailinfo.c +2 −4
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index 5ebc8b5..c68187e 100644
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
@@ -193,8 +193,7 @@ static void handle_content_type(struct strbuf *line)
 		*content_top = boundary;
 		boundary = NULL;
 	}
-	if (slurp_attr(line->buf, "charset=", &charset))
-		strbuf_tolower(&charset);
+	slurp_attr(line->buf, "charset=", &charset);
 
 	if (boundary) {
 		strbuf_release(boundary);
@@ -494,7 +493,7 @@ static void convert_to_utf8(struct strbuf *line, const char *charset)
 			return;
 	}
 
-	if (!strcmp(metainfo_charset, charset))
+	if (!strcasecmp(metainfo_charset, charset))
 		return;
 	out = reencode_string(line->buf, metainfo_charset, charset);
 	if (!out)
@@ -550,7 +549,6 @@ static int decode_header_bq(struct strbuf *it)
 		if (cp + 3 - it->buf > it->len)
 			goto decode_header_bq_out;
 		strbuf_add(&charset_q, ep, cp - ep);
-		strbuf_tolower(&charset_q);
 
 		encoding = cp[1];
 		if (!encoding || cp[2] != '?')
-- 
1.6.3.1.24.g152f4
Brandon Casey· May 18, 2009, 23:44 UTC · re: Brandon Casey · lore

[PATCH 4/8] builtin-mailinfo.c: use "ISO8859-1" instead of "latin1" as fallback encoding

Some platforms do not understand the character encoding "latin1" which is another name for "ISO8859-1". So use "ISO8859-1" instead which all tested platforms understand.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 builtin-mailinfo.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to builtin-mailinfo.c +1 −1
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index c68187e..92637ac 100644
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
@@ -480,7 +480,7 @@ static const char *guess_charset(const struct strbuf *line, const char *target_c
 		if (is_utf8(line->buf))
 			return NULL;
 	}
-	return "latin1";
+	return "ISO8859-1";
 }
 
 static void convert_to_utf8(struct strbuf *line, const char *charset)
-- 
1.6.3.1.24.g152f4
Brandon Casey· May 18, 2009, 23:44 UTC · re: Brandon Casey · lore

[PATCH 5/8] t3901: avoid negation on right hand side of '|'

Some shells do not properly handle constructs of the form:
   spew_something | ! process_input
So rewrite this to be:
   spew_something | process_input; test $? != 0
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 t/t3901-i18n-patch.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to t/t3901-i18n-patch.sh +1 −1
diff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh
index 7655da3..b04f74a 100755
--- a/t/t3901-i18n-patch.sh
+++ b/t/t3901-i18n-patch.sh
@@ -19,7 +19,7 @@ check_encoding () {
 		8859)
 			grep "^encoding ISO-8859-1" ;;
 		*)
-			! grep "^encoding ISO-8859-1" ;;
+			grep "^encoding ISO-8859-1"; test "$?" != 0 ;;
 		esac || {
 			bad=1
 			break
-- 
1.6.3.1.24.g152f4
Brandon Casey· May 18, 2009, 23:44 UTC · re: Brandon Casey · lore

[PATCH 6/8] t3901: Use ISO8859-1 instead of ISO-8859-1 for backward compatibility

Some ancient platforms do not have an extensive list of alternate names for character encodings. For example, Solaris 7 does not know that ISO-8859-1 is the same as ISO8859-1. Modern platforms do know this, so use the older name.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 t/t3901-i18n-patch.sh |   40 ++++++++++++++++++++--------------------
 1 files changed, 20 insertions(+), 20 deletions(-)
Show changes to t/t3901-i18n-patch.sh +20 −20
diff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh
index b04f74a..31a5770 100755
--- a/t/t3901-i18n-patch.sh
+++ b/t/t3901-i18n-patch.sh
@@ -17,9 +17,9 @@ check_encoding () {
 		git cat-file commit HEAD~$j |
 		case "$header" in
 		8859)
-			grep "^encoding ISO-8859-1" ;;
+			grep "^encoding ISO8859-1" ;;
 		*)
-			grep "^encoding ISO-8859-1"; test "$?" != 0 ;;
+			grep "^encoding ISO8859-1"; test "$?" != 0 ;;
 		esac || {
 			bad=1
 			break
@@ -55,7 +55,7 @@ test_expect_success setup '
 	git commit -s -m "Second on side" &&
 
 	# the second one on the side branch is ISO-8859-1
-	git config i18n.commitencoding ISO-8859-1 &&
+	git config i18n.commitencoding ISO8859-1 &&
 	# use author and committer name in ISO-8859-1 to match it.
 	. "$TEST_DIRECTORY"/t3901-8859-1.txt &&
 	test_tick &&
@@ -68,14 +68,14 @@ test_expect_success setup '
 '
 
 test_expect_success 'format-patch output (ISO-8859-1)' '
-	git config i18n.logoutputencoding ISO-8859-1 &&
+	git config i18n.logoutputencoding ISO8859-1 &&
 
 	git format-patch --stdout master..HEAD^ >out-l1 &&
 	git format-patch --stdout HEAD^ >out-l2 &&
-	grep "^Content-Type: text/plain; charset=ISO-8859-1" out-l1 &&
-	grep "^From: =?ISO-8859-1?q?=C1=E9=ED=20=F3=FA?=" out-l1 &&
-	grep "^Content-Type: text/plain; charset=ISO-8859-1" out-l2 &&
-	grep "^From: =?ISO-8859-1?q?=C1=E9=ED=20=F3=FA?=" out-l2
+	grep "^Content-Type: text/plain; charset=ISO8859-1" out-l1 &&
+	grep "^From: =?ISO8859-1?q?=C1=E9=ED=20=F3=FA?=" out-l1 &&
+	grep "^Content-Type: text/plain; charset=ISO8859-1" out-l2 &&
+	grep "^From: =?ISO8859-1?q?=C1=E9=ED=20=F3=FA?=" out-l2
 '
 
 test_expect_success 'format-patch output (UTF-8)' '
@@ -110,7 +110,7 @@ test_expect_success 'rebase (U/U)' '
 
 test_expect_success 'rebase (U/L)' '
 	git config i18n.commitencoding UTF-8 &&
-	git config i18n.logoutputencoding ISO-8859-1 &&
+	git config i18n.logoutputencoding ISO8859-1 &&
 	. "$TEST_DIRECTORY"/t3901-utf8.txt &&
 
 	git reset --hard side &&
@@ -121,8 +121,8 @@ test_expect_success 'rebase (U/L)' '
 
 test_expect_success 'rebase (L/L)' '
 	# In this test we want ISO-8859-1 encoded commits as the result
-	git config i18n.commitencoding ISO-8859-1 &&
-	git config i18n.logoutputencoding ISO-8859-1 &&
+	git config i18n.commitencoding ISO8859-1 &&
+	git config i18n.logoutputencoding ISO8859-1 &&
 	. "$TEST_DIRECTORY"/t3901-8859-1.txt &&
 
 	git reset --hard side &&
@@ -134,7 +134,7 @@ test_expect_success 'rebase (L/L)' '
 test_expect_success 'rebase (L/U)' '
 	# This is pathological -- use UTF-8 as intermediate form
 	# to get ISO-8859-1 results.
-	git config i18n.commitencoding ISO-8859-1 &&
+	git config i18n.commitencoding ISO8859-1 &&
 	git config i18n.logoutputencoding UTF-8 &&
 	. "$TEST_DIRECTORY"/t3901-8859-1.txt &&
 
@@ -162,8 +162,8 @@ test_expect_success 'cherry-pick(U/U)' '
 test_expect_success 'cherry-pick(L/L)' '
 	# Both the commitencoding and logoutputencoding is set to ISO-8859-1
 
-	git config i18n.commitencoding ISO-8859-1 &&
-	git config i18n.logoutputencoding ISO-8859-1 &&
+	git config i18n.commitencoding ISO8859-1 &&
+	git config i18n.logoutputencoding ISO8859-1 &&
 	. "$TEST_DIRECTORY"/t3901-8859-1.txt &&
 
 	git reset --hard master &&
@@ -178,7 +178,7 @@ test_expect_success 'cherry-pick(U/L)' '
 	# Commitencoding is set to UTF-8 but logoutputencoding is ISO-8859-1
 
 	git config i18n.commitencoding UTF-8 &&
-	git config i18n.logoutputencoding ISO-8859-1 &&
+	git config i18n.logoutputencoding ISO8859-1 &&
 	. "$TEST_DIRECTORY"/t3901-utf8.txt &&
 
 	git reset --hard master &&
@@ -193,7 +193,7 @@ test_expect_success 'cherry-pick(L/U)' '
 	# Again, the commitencoding is set to ISO-8859-1 but
 	# logoutputencoding is set to UTF-8.
 
-	git config i18n.commitencoding ISO-8859-1 &&
+	git config i18n.commitencoding ISO8859-1 &&
 	git config i18n.logoutputencoding UTF-8 &&
 	. "$TEST_DIRECTORY"/t3901-8859-1.txt &&
 
@@ -218,7 +218,7 @@ test_expect_success 'rebase --merge (U/U)' '
 
 test_expect_success 'rebase --merge (U/L)' '
 	git config i18n.commitencoding UTF-8 &&
-	git config i18n.logoutputencoding ISO-8859-1 &&
+	git config i18n.logoutputencoding ISO8859-1 &&
 	. "$TEST_DIRECTORY"/t3901-utf8.txt &&
 
 	git reset --hard side &&
@@ -229,8 +229,8 @@ test_expect_success 'rebase --merge (U/L)' '
 
 test_expect_success 'rebase --merge (L/L)' '
 	# In this test we want ISO-8859-1 encoded commits as the result
-	git config i18n.commitencoding ISO-8859-1 &&
-	git config i18n.logoutputencoding ISO-8859-1 &&
+	git config i18n.commitencoding ISO8859-1 &&
+	git config i18n.logoutputencoding ISO8859-1 &&
 	. "$TEST_DIRECTORY"/t3901-8859-1.txt &&
 
 	git reset --hard side &&
@@ -242,7 +242,7 @@ test_expect_success 'rebase --merge (L/L)' '
 test_expect_success 'rebase --merge (L/U)' '
 	# This is pathological -- use UTF-8 as intermediate form
 	# to get ISO-8859-1 results.
-	git config i18n.commitencoding ISO-8859-1 &&
+	git config i18n.commitencoding ISO8859-1 &&
 	git config i18n.logoutputencoding UTF-8 &&
 	. "$TEST_DIRECTORY"/t3901-8859-1.txt &&
 
-- 
1.6.3.1.24.g152f4
Brandon Casey· May 18, 2009, 23:44 UTC · re: Brandon Casey · lore

[PATCH 7/8] t9301: use ISO8859-1 rather than ISO-8859-1

Some ancient platforms do not have an extensive list of alternate names for character encodings. For example, Solaris 7 does not know that ISO-8859-1 is the same as ISO8859-1. Modern platforms do know this, so use the older name.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
Feel free to squash.
 t/t9301-fast-export.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to t/t9301-fast-export.sh +1 −1
diff --git a/t/t9301-fast-export.sh b/t/t9301-fast-export.sh
index 8da9ce5..8c8a9e6 100755
--- a/t/t9301-fast-export.sh
+++ b/t/t9301-fast-export.sh
@@ -68,7 +68,7 @@ test_expect_success 'fast-export master~2..master' '
 
 test_expect_success 'iso-8859-1' '
 
-	git config i18n.commitencoding ISO-8859-1 &&
+	git config i18n.commitencoding ISO8859-1 &&
 	# use author and committer name in ISO-8859-1 to match it.
 	. "$TEST_DIRECTORY"/t3901-8859-1.txt &&
 	test_tick &&
-- 
1.6.3.1.24.g152f4
Brandon Casey· May 18, 2009, 23:44 UTC · re: Brandon Casey · lore

[PATCH 8/8] t5100: use ancient encoding syntax for backwards compatibility

Some ancient platforms do not have an extensive list of alternate names for character encodings. For example, Solaris 7 does not know that ISO-8859-1 is the same as ISO8859-1. Modern platforms do know this, so use the older names.

The following conversions were performed:
    ISO-8859-1 --> ISO8859-1
    ISO-8859-2 --> ISO8859-2
    ISO-8859-8 --> ISO8859-8
    iso-2022-jp --> ISO-2022-JP
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
 t/t5100/rfc2047-samples.mbox |   32 ++++++++++++++++----------------
 t/t5100/sample.mbox          |    8 ++++----
 2 files changed, 20 insertions(+), 20 deletions(-)
Show changes to 2 files +20 −20

t/t5100/rfc2047-samples.mbox, t/t5100/sample.mbox

diff --git a/t/t5100/rfc2047-samples.mbox b/t/t5100/rfc2047-samples.mbox
index 3ca2470..1fc2248 100644
--- a/t/t5100/rfc2047-samples.mbox
+++ b/t/t5100/rfc2047-samples.mbox
@@ -1,48 +1,48 @@
 From nobody Mon Sep 17 00:00:00 2001
 From: =?US-ASCII?Q?Keith_Moore?= <moore@cs.utk.edu>
-To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>
-CC: =?ISO-8859-1?Q?Andr=E9?= Pirard <PIRARD@vm1.ulg.ac.be>
-Subject: =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=
- =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=
+To: =?ISO8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>
+CC: =?ISO8859-1?Q?Andr=E9?= Pirard <PIRARD@vm1.ulg.ac.be>
+Subject: =?ISO8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=
+ =?ISO8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=
 
 From nobody Mon Sep 17 00:00:00 2001
-From: =?ISO-8859-1?Q?Olle_J=E4rnefors?= <ojarnef@admin.kth.se>
+From: =?ISO8859-1?Q?Olle_J=E4rnefors?= <ojarnef@admin.kth.se>
 To: ietf-822@dimacs.rutgers.edu, ojarnef@admin.kth.se
 Subject: Time for ISO 10646?
 
 From nobody Mon Sep 17 00:00:00 2001
 To: Dave Crocker <dcrocker@mordor.stanford.edu>
 Cc: ietf-822@dimacs.rutgers.edu, paf@comsol.se
-From: =?ISO-8859-1?Q?Patrik_F=E4ltstr=F6m?= <paf@nada.kth.se>
+From: =?ISO8859-1?Q?Patrik_F=E4ltstr=F6m?= <paf@nada.kth.se>
 Subject: Re: RFC-HDR care and feeding
 
 From nobody Mon Sep 17 00:00:00 2001
 From: Nathaniel Borenstein <nsb@thumper.bellcore.com>
-      (=?iso-8859-8?b?7eXs+SDv4SDp7Oj08A==?=)
+      (=?ISO8859-8?b?7eXs+SDv4SDp7Oj08A==?=)
 To: Greg Vaudreuil <gvaudre@NRI.Reston.VA.US>, Ned Freed
    <ned@innosoft.com>, Keith Moore <moore@cs.utk.edu>
 Subject: Test of new header generator
 MIME-Version: 1.0
-Content-type: text/plain; charset=ISO-8859-1
+Content-type: text/plain; charset=ISO8859-1
 
 From nobody Mon Sep 17 00:00:00 2001
-Subject: (=?ISO-8859-1?Q?a?=)
+Subject: (=?ISO8859-1?Q?a?=)
 
 From nobody Mon Sep 17 00:00:00 2001
-Subject: (=?ISO-8859-1?Q?a?= b)
+Subject: (=?ISO8859-1?Q?a?= b)
 
 From nobody Mon Sep 17 00:00:00 2001
-Subject: (=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=)
+Subject: (=?ISO8859-1?Q?a?= =?ISO8859-1?Q?b?=)
 
 From nobody Mon Sep 17 00:00:00 2001
-Subject: (=?ISO-8859-1?Q?a?=  =?ISO-8859-1?Q?b?=)
+Subject: (=?ISO8859-1?Q?a?=  =?ISO8859-1?Q?b?=)
 
 From nobody Mon Sep 17 00:00:00 2001
-Subject: (=?ISO-8859-1?Q?a?=
-    =?ISO-8859-1?Q?b?=)
+Subject: (=?ISO8859-1?Q?a?=
+    =?ISO8859-1?Q?b?=)
 
 From nobody Mon Sep 17 00:00:00 2001
-Subject: (=?ISO-8859-1?Q?a_b?=)
+Subject: (=?ISO8859-1?Q?a_b?=)
 
 From nobody Mon Sep 17 00:00:00 2001
-Subject: (=?ISO-8859-1?Q?a?= =?ISO-8859-2?Q?_b?=)
+Subject: (=?ISO8859-1?Q?a?= =?ISO8859-2?Q?_b?=)
diff --git a/t/t5100/sample.mbox b/t/t5100/sample.mbox
index c5ad206..c3074ac 100644
--- a/t/t5100/sample.mbox
+++ b/t/t5100/sample.mbox
@@ -99,7 +99,7 @@ index 9123cdc..918dcf8 100644
 From nobody Sat Aug 27 23:07:49 2005
 Path: news.gmane.org!not-for-mail
 Message-ID: <20050721.091036.01119516.yoshfuji@linux-ipv6.org>
-From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= 
+From: YOSHIFUJI Hideaki / =?ISO-2022-JP?B?GyRCNUhGIzFRTEAbKEI=?= 
 	<yoshfuji@linux-ipv6.org>
 Newsgroups: gmane.comp.version-control.git
 Subject: [PATCH 1/2] GIT: Try all addresses for given remote name
@@ -218,7 +218,7 @@ GPG-FP  : 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA
 From nobody Sat Aug 27 23:07:49 2005
 Path: news.gmane.org!not-for-mail
 Message-ID: <u5tacjjdpxq.fsf@lysator.liu.se>
-From: =?iso-8859-1?Q?David_K=E5gedal?= <davidk@lysator.liu.se>
+From: =?ISO8859-1?Q?David_K=E5gedal?= <davidk@lysator.liu.se>
 Newsgroups: gmane.comp.version-control.git
 Subject: [PATCH] Fixed two bugs in git-cvsimport-script.
 Date: Mon, 15 Aug 2005 20:18:25 +0200
@@ -226,7 +226,7 @@ Lines: 83
 Approved: news@gmane.org
 NNTP-Posting-Host: main.gmane.org
 Mime-Version: 1.0
-Content-Type: text/plain; charset=iso-8859-1
+Content-Type: text/plain; charset=ISO8859-1
 Content-Transfer-Encoding: QUOTED-PRINTABLE
 X-Trace: sea.gmane.org 1124130247 31839 80.91.229.2 (15 Aug 2005 18:24:07 GMT)
 X-Complaints-To: usenet@sea.gmane.org
@@ -476,7 +476,7 @@ MIME-Version: 1.0
 Content-Type: multipart/mixed; boundary="=-=-="
 
 --=-=-=
-Content-Type: text/plain; charset=iso-8859-15
+Content-Type: text/plain; charset=ISO8859-15
 Content-Transfer-Encoding: quoted-printable
 
 Here comes a commit log message, and
-- 
1.6.3.1.24.g152f4

← back to recent threads