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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Brandon Casey committed
May 18, 2009 at 18:44 UTC
5ae93dfdccfe9457bdb1f54b33c76359f6c3b861
5 files changed
+20
-20
t/t3900-i18n-commit.sh
+14
-14
@@ -34,7 +34,7 @@ test_expect_success 'no encoding header for base case' '
34
test z = "z$E"
35
'
36
37
-for H in ISO-8859-1 EUCJP ISO-2022-JP
37
+for H in ISO8859-1 eucJP ISO-2022-JP
38
do
39
test_expect_success "$H setup" '
40
git config i18n.commitencoding $H &&
@@ -44,7 +44,7 @@ do
44
'
45
done
46
47
-for H in ISO-8859-1 EUCJP ISO-2022-JP
47
+for H in ISO8859-1 eucJP ISO-2022-JP
48
do
49
test_expect_success "check encoding header for $H" '
50
E=$(git cat-file commit '$H' | sed -ne "s/^encoding //p") &&
@@ -61,14 +61,14 @@ test_expect_success 'config to remove customization' '
61
else
62
test z = "z$Z"
63
fi &&
64
- git config i18n.commitencoding utf-8
64
+ git config i18n.commitencoding UTF-8
65
'
66
67
-test_expect_success 'ISO-8859-1 should be shown in UTF-8 now' '
68
- compare_with ISO-8859-1 "$TEST_DIRECTORY"/t3900/1-UTF-8.txt
67
+test_expect_success 'ISO8859-1 should be shown in UTF-8 now' '
68
+ compare_with ISO8859-1 "$TEST_DIRECTORY"/t3900/1-UTF-8.txt
69
'
70
71
-for H in EUCJP ISO-2022-JP
71
+for H in eucJP ISO-2022-JP
72
do
73
test_expect_success "$H should be shown in UTF-8 now" '
74
compare_with '$H' "$TEST_DIRECTORY"/t3900/2-UTF-8.txt
@@ -86,7 +86,7 @@ test_expect_success 'config to add customization' '
86
fi
87
'
88
89
-for H in ISO-8859-1 EUCJP ISO-2022-JP
89
+for H in ISO8859-1 eucJP ISO-2022-JP
90
do
91
test_expect_success "$H should be shown in itself now" '
92
git config i18n.commitencoding '$H' &&
@@ -95,21 +95,21 @@ do
95
done
96
97
test_expect_success 'config to tweak customization' '
98
- git config i18n.logoutputencoding utf-8
98
+ git config i18n.logoutputencoding UTF-8
99
'
100
101
-test_expect_success 'ISO-8859-1 should be shown in UTF-8 now' '
102
- compare_with ISO-8859-1 "$TEST_DIRECTORY"/t3900/1-UTF-8.txt
101
+test_expect_success 'ISO8859-1 should be shown in UTF-8 now' '
102
+ compare_with ISO8859-1 "$TEST_DIRECTORY"/t3900/1-UTF-8.txt
103
'
104
105
-for H in EUCJP ISO-2022-JP
105
+for H in eucJP ISO-2022-JP
106
do
107
test_expect_success "$H should be shown in UTF-8 now" '
108
compare_with '$H' "$TEST_DIRECTORY"/t3900/2-UTF-8.txt
109
'
110
done
111
112
-for J in EUCJP ISO-2022-JP
112
+for J in eucJP ISO-2022-JP
113
do
114
if test "$J" = ISO-2022-JP
115
then
@@ -118,7 +118,7 @@ do
118
ICONV=
119
fi
120
git config i18n.logoutputencoding $J
121
- for H in EUCJP ISO-2022-JP
121
+ for H in eucJP ISO-2022-JP
122
do
123
test_expect_success "$H should be shown in $J now" '
124
compare_with '$H' "$TEST_DIRECTORY"/t3900/'$J'.txt $ICONV
@@ -126,7 +126,7 @@ do
126
done
127
done
128
129
-for H in ISO-8859-1 EUCJP ISO-2022-JP
129
+for H in ISO8859-1 eucJP ISO-2022-JP
130
do
131
test_expect_success "No conversion with $H" '
132
compare_with "--encoding=none '$H'" "$TEST_DIRECTORY"/t3900/'$H'.txt
t/t3900/ISO8859-1.txt
renamed
t/t3900/eucJP.txt
renamed
t/t9129-git-svn-i18n-commitencoding.sh
+5
-5
@@ -29,7 +29,7 @@ compare_svn_head_with () {
29
test_cmp current "$1"
30
}
31
32
-for H in ISO-8859-1 EUCJP ISO-2022-JP
32
+for H in ISO8859-1 eucJP ISO-2022-JP
33
do
34
test_expect_success "$H setup" '
35
mkdir $H &&
@@ -38,7 +38,7 @@ do
38
'
39
done
40
41
-for H in ISO-8859-1 EUCJP ISO-2022-JP
41
+for H in ISO8859-1 eucJP ISO-2022-JP
42
do
43
test_expect_success "$H commit on git side" '
44
(
@@ -55,7 +55,7 @@ do
55
'
56
done
57
58
-for H in ISO-8859-1 EUCJP ISO-2022-JP
58
+for H in ISO8859-1 eucJP ISO-2022-JP
59
do
60
test_expect_success "$H dcommit to svn" '
61
(
@@ -77,12 +77,12 @@ fi
77
78
test_expect_success UTF8 'ISO-8859-1 should match UTF-8 in svn' '
79
(
80
- cd ISO-8859-1 &&
80
+ cd ISO8859-1 &&
81
compare_svn_head_with "$TEST_DIRECTORY"/t3900/1-UTF-8.txt
82
)
83
'
84
85
-for H in EUCJP ISO-2022-JP
85
+for H in eucJP ISO-2022-JP
86
do
87
test_expect_success UTF8 "$H should match UTF-8 in svn" '
88
(
t/t9500-gitweb-standalone-no-errors.sh
+1
-1
@@ -590,7 +590,7 @@ test_expect_success \
590
echo "ISO-8859-1" >> file &&
591
git add file &&
592
git config i18n.commitencoding ISO-8859-1 &&
593
- git commit -F "$TEST_DIRECTORY"/t3900/ISO-8859-1.txt &&
593
+ git commit -F "$TEST_DIRECTORY"/t3900/ISO8859-1.txt &&
594
git config --unset i18n.commitencoding &&
595
gitweb_run "p=.git;a=commit"'
596
test_debug 'cat gitweb.log'