1#! /bin/sh 2 3# Test recode-sr-latin on some input in EUC-JP encoding. 4# (Apart from UTF-8 and GB18030, EUC-JP is the only common encoding that is 5# a superset of both ISO-8859-5 and ISO-8859-2.) 6 7tmpfiles="" 8trap 'rm -fr $tmpfiles' 1 2 3 15 9 10# Test whether a specific EUC-JP locale is installed. 11case "$host_os" in 12 aix*) 13 LOCALE_JA_EUCJP=ja_JP ;; 14 hpux* | osf* | netbsd*) 15 LOCALE_JA_EUCJP=ja_JP.eucJP ;; 16 irix* | freebsd* | darwin*) 17 LOCALE_JA_EUCJP=ja_JP.EUC ;; 18 *) 19 LOCALE_JA_EUCJP=ja_JP.EUC-JP ;; 20esac 21if test $LOCALE_JA_EUCJP != none; then 22 LC_ALL=$LOCALE_JA_EUCJP ./testlocale 2>/dev/null 23 case $? in 24 0) ;; 25 77) LOCALE_JA_EUCJP=none;; 26 *) exit 1;; 27 esac 28fi 29if test $LOCALE_JA_EUCJP = none; then 30 if test -f /usr/bin/localedef; then 31 echo "Skipping test: no japanese EUC-JP locale is installed" 32 else 33 echo "Skipping test: no japanese EUC-JP locale is supported" 34 fi 35 rm -fr $tmpfiles; exit 77 36fi 37 38# Test whether locale_charset() in this locale really returns EUC-JP. 39# (On some systems, config.charset supports only UTF-8 locales.) 40case "$host_os" in 41 darwin[56]*) ;; 42 darwin* | beos*) 43 echo "Skipping test: no EUC-JP locale is supported" 44 rm -fr $tmpfiles; exit 77 45 ;; 46esac 47 48tmpfiles="$tmpfiles rec-srl-2.in" 49cat <<\EOF > rec-srl-2.in 50������ѧӧߧ� �ѧ�ԧ�ާ֧ߧ�� ��� 51�ߧ֏���֧էߧ�٧ߧѧ�ѧ� �ѧ�ԧ�ާ֧ߧ� 52EOF 53 54tmpfiles="$tmpfiles rec-srl-2.out" 55: ${RECODE=recode} 56LC_ALL=$LOCALE_JA_EUCJP \ 57${RECODE}-sr-latin < rec-srl-2.in > rec-srl-2.out \ 58 || { rm -fr $tmpfiles; exit 1; } 59 60tmpfiles="$tmpfiles rec-srl-2.ok" 61cat <<\EOF > rec-srl-2.ok 62Ispravni argumenti su 63nejednozna���an argument 64EOF 65 66: ${DIFF=diff} 67${DIFF} rec-srl-2.ok rec-srl-2.out 68result=$? 69 70rm -fr $tmpfiles 71 72exit $result 73