Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / msgconv-1
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test conversion from BIG5 to UTF-8.
5
6 cat <<\EOF > mco-test1.po
7 # Chinese translation for GNU gettext messages.
8 #
9 msgid ""
10 msgstr ""
11 "MIME-Version: 1.0\n"
12 "Content-Type: text/plain; charset=big5\n"
13 "Content-Transfer-Encoding: 8bit\n"
14
15 #: src/msgcmp.c:155 src/msgmerge.c:273
16 msgid "exactly 2 input files required"
17 msgstr "¦¹¥\¯à»Ý­n«ê¦n«ü©w¨â­Ó¿é¤JÀÉ"
18 EOF
19
20 : ${MSGCONV=msgconv}
21 ${MSGCONV} --to-code=UTF-8 -o mco-test1.out mco-test1.po || exit 1
22
23 cat <<\EOF > mco-test1.ok
24 # Chinese translation for GNU gettext messages.
25 #
26 msgid ""
27 msgstr ""
28 "MIME-Version: 1.0\n"
29 "Content-Type: text/plain; charset=UTF-8\n"
30 "Content-Transfer-Encoding: 8bit\n"
31
32 #: src/msgcmp.c:155 src/msgmerge.c:273
33 msgid "exactly 2 input files required"
34 msgstr "此功能需要恰好指定兩個輸入檔"
35 EOF
36
37 : ${DIFF=diff}
38 # Redirect stdout, so as not to fill the user's screen with non-ASCII bytes.
39 ${DIFF} mco-test1.ok mco-test1.out >/dev/null
40 result=$?
41
42 exit $result