]>
diplodocus.org Git - nmh/blob - test/mhshow/test-charset
2 ######################################################
4 # Test charset conversion functionality
6 ######################################################
10 if test -z "${MH_OBJ_DIR}"; then
11 srcdir
=`dirname "$0"`/..
/..
12 MH_OBJ_DIR
=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
15 .
"$MH_OBJ_DIR/test/common.sh"
19 check_exit
'-eq 1' mhshow
-
21 require_locale en_US.UTF
-8 en_US.UTF8 en_US.utf
-8 en_US.utf8
23 test "$ICONV_ENABLED" -eq 0 && text_size
=10 || text_size
=11
25 expected
=$MH_TEST_DIR/$$.expected
26 actual
=$MH_TEST_DIR/$$.actual
28 echo 'mhshow-charset-windows-1252: echo "This is a test"' >> "$MH"
30 # Write message with bogus quoted-printable data.
31 start_test
'Write message with bogus quoted-printable data'
33 msgnum
=`basename $msgfile`
39 Content-Type: text/plain; charset=windows-1252
40 Content-Transfer-Encoding: quoted-printable
41 Content-Description: bogus quoted-printable data
42 Date: Sun, 18 Dec 2005 00:52:39 +0100
49 Date: Sun, 18 Dec 2005 00:52:39 +0100
55 Content-Description: bogus quoted-printable data
57 [ part - text/plain - bogus quoted-printable data ${text_size}B ]
61 run_prog mhshow
$msgnum > $actual 2>&1
62 check
"$expected" "$actual" 'keep first' : bogus quoted
-printable data
65 start_test
'locale profile component'
66 #### Used LC_ALL above, now use locale profile component instead.
67 printf "locale: $LC_ALL\n" >> "${MH}"
70 run_prog mhshow
$msgnum > $actual 2>&1
71 check
"$expected" "$actual" : locale profile component
74 start_test
'Encoded parameter value'
76 msgnum
=`basename $msgfile`
82 Content-Type: text/plain; charset*=EBCDIC-US''%e4%e3%c6%60%f8
83 Content-Transfer-Encoding: quoted-printable
84 Content-Description: bogus quoted-printable data
85 Date: Sun, 18 Dec 2005 00:52:39 +0100
92 Date: Sun, 18 Dec 2005 00:52:39 +0100
98 Content-Description: bogus quoted-printable data
100 [ part - text/plain - bogus quoted-printable data ${text_size}B ]
104 run_prog mhshow
$msgnum > $actual 2>&1
105 check
"$expected" "$actual" : encoded parameter value
108 start_test
'replacement character in parameter value'
109 #### The output of this test doesn't show it, but it covers the
110 #### noiconv: portion of get_param_value().
111 cat > $msgfile <<'EOF'
112 Subject: invalid parameter value charset
114 Content-Type: text/plain; charset*=invalid''%0Dus-ascii
117 cat > $expected <<EOF
119 Subject: invalid parameter value charset
123 [ part - text/plain - 0B ]
126 run_prog mhshow
$msgnum > $actual 2>&1
127 check
"$expected" "$actual"