]> diplodocus.org Git - nmh/blob - test/mhl/test-rfc6532
Disabled incompatible locale check because the output varies too
[nmh] / test / mhl / test-rfc6532
1 #!/bin/sh
2 ######################################################
3 #
4 # Test compatibility with RFC 6532, Internationalized
5 # Email Headers
6 #
7 ######################################################
8
9 set -e
10
11 if test -z "${MH_OBJ_DIR}"; then
12 srcdir=`dirname $0`/../..
13 MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR
14 fi
15
16 . "${MH_OBJ_DIR}/test/common.sh"
17
18 setup_test
19 mhl="${MH_LIBEXEC_DIR}/mhl"
20
21 #### Make sure that html-to-text conversion is what we expect.
22 require_locale en_US.utf-8 en_US.utf8
23 LC_ALL=en_US.UTF-8; export LC_ALL
24
25
26 # check UTF-8 headers
27 start_test 'UTF-8 headers'
28 cat >"$MH_TEST_DIR"/Mail/inbox/11 <<EOF
29 From: senderø@example.com
30 To: recipientæ@example.com
31 Subject: Blåbærsyltetøy
32 Date: 20 May 2014 14:28:51 +0200
33 MIME-Version: 1.0
34 Content-Type: text/plain; charset="UTF-8"
35 Content-Transfer-Encoding: 8bit
36
37 Blåbærsyltetøy er veldig godt. Jeg liker blåbærsyltetøy.
38 Jøran.
39
40 Text source:
41 Arnt Gulbrandsen and Jiankang Yao, "Email Address Internationalization",
42 Computing Edge 1:6, June 2015,
43 http://www.computer.org/cms/computing-edge/ce-jun15-final.pdf, p. 50.
44 EOF
45
46 #### Just check that the (UTF-8) headers are displayed unscathed. run_test
47 #### squashes the trailing blank lines from mhl.
48 run_test "$mhl -form mhl.headers `mhpath last`" \
49 'Date: 20 May 2014 14:28:51 +0200
50 To: recipientæ@example.com
51 From: senderø@example.com
52 Subject: Blåbærsyltetøy
53
54 MIME-Version: 1.0'
55
56
57 # check with incompatible locale
58 # This is here as a place holder. We should either try to run the (8-bit) text
59 # through iconv, or refuse to display it if the locale is incompatible. In the
60 # cAse of EAI, that means not UTF-8.
61 # start_test 'incompatible locale'
62 # LC_ALL=C
63 # run_test "$mhl -form mhl.headers `mhpath last`" \
64 # 'Date: 20 May 2014 14:28:51 +0200
65 # To: recipientæ@example.com
66 # From: sender??@example.com
67 # Subject: Bl??b??rsyltet??y
68 #
69 # MIME-Version: 1.0'
70
71
72 finish_test
73 exit $failed