Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / recode-sr-latin-2
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test recode-sr-latin on some input in EUC-JP encoding.
5 # (Apart from UTF-8 and GB18030, EUC-JP is the only common encoding that is
6 # a superset of both ISO-8859-5 and ISO-8859-2.)
7
8 # Note: This test fails on AIX 4 with libiconv < 1.12, due to an interaction
9 # between libiconv and the setlocale() function. It is fixed in libiconv-1.12.
10
11 # Test whether a specific EUC-JP locale is installed.
12 : ${LOCALE_JA=ja_JP}
13 if test $LOCALE_JA = none; then
14   if test -f /usr/bin/localedef; then
15     echo "Skipping test: no japanese EUC-JP locale is installed"
16   else
17     echo "Skipping test: no japanese EUC-JP locale is supported"
18   fi
19   exit 77
20 fi
21
22 cat <<\EOF > rec-srl-2.in
23 §ª§ã§á§â§Ñ§Ó§ß§Ú §Ñ§â§Ô§å§Þ§Ö§ß§ä§Ú §ã§å
24 §ß§Ö\8f§ø§Ö§Õ§ß§à§Ù§ß§Ñ§é§Ñ§ß §Ñ§â§Ô§å§Þ§Ö§ß§ä
25 EOF
26
27 : ${RECODE=recode}
28 LC_ALL=$LOCALE_JA \
29 ${RECODE}-sr-latin < rec-srl-2.in > rec-srl-2.out \
30   || { exit 1; }
31
32 cat <<\EOF > rec-srl-2.ok
33 Ispravni argumenti su
34 nejednozna\8f«­an argument
35 EOF
36
37 : ${DIFF=diff}
38 ${DIFF} rec-srl-2.ok rec-srl-2.out
39 result=$?
40
41 exit $result