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}
13if 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
20fi
21
22cat <<\EOF > rec-srl-2.in
23������ѧӧߧ� �ѧ�ԧ�ާ֧ߧ�� ���
24�ߧ֏���֧էߧ�٧ߧѧ�ѧ� �ѧ�ԧ�ާ֧ߧ�
25EOF
26
27: ${RECODE=recode}
28LC_ALL=$LOCALE_JA \
29${RECODE}-sr-latin < rec-srl-2.in > rec-srl-2.out \
30  || { Exit 1; }
31
32cat <<\EOF > rec-srl-2.ok
33Ispravni argumenti su
34nejednozna���an argument
35EOF
36
37: ${DIFF=diff}
38${DIFF} rec-srl-2.ok rec-srl-2.out
39result=$?
40
41exit $result
42