| 1 |
#! /bin/sh -vx |
| 2 |
# $Id$ |
| 3 |
# Copyright 2024 Japanese TeX Development Community <[email protected]> |
| 4 |
# You may freely use, modify and/or distribute this file. |
| 5 |
|
| 6 |
# Not really a test, just making sure the program executes. |
| 7 |
|
| 8 |
BinDir=${BinDir:-.} |
| 9 |
ExeExt=${ExeExt:-} |
| 10 |
_ptekf=$BinDir/ptekf$ExeExt |
| 11 |
|
| 12 |
TEXMFCNF=$srcdir/../kpathsea |
| 13 |
web2cdir=$srcdir/../web2c |
| 14 |
|
| 15 |
export TEXMFCNF |
| 16 |
|
| 17 |
rm -f ./saza*.txt* |
| 18 |
|
| 19 |
# "さざ波" -> \343\201\225\343\201\226\346\263\242 |
| 20 |
jstr='\343\201\225\343\201\226\346\263\242' |
| 21 |
astr='Ripples' |
| 22 |
cr='\015' |
| 23 |
lf='\012' |
| 24 |
crlf='\015\012' |
| 25 |
|
| 26 |
printf "$astr$cr$jstr$cr$astr $jstr$cr$jstr" > saza-utf8-cr0.txt |
| 27 |
printf "$astr$lf$jstr$lf$astr $jstr$lf$jstr" > saza-utf8-lf0.txt |
| 28 |
printf "$astr$crlf$jstr$crlf$astr $jstr$crlf$jstr" > saza-utf8-crlf0.txt |
| 29 |
printf "$astr$cr$jstr$lf$astr $jstr$crlf$jstr" > saza-utf8-mix.txt |
| 30 |
printf "$astr$cr$jstr$cr$astr $jstr$cr$jstr$cr" > saza-utf8-cr1.txt |
| 31 |
printf "$astr$lf$jstr$lf$astr $jstr$lf$jstr$lf" > saza-utf8-lf1.txt |
| 32 |
printf "$astr$crlf$jstr$crlf$astr $jstr$crlf$jstr$crlf" > saza-utf8-crlf1.txt |
| 33 |
|
| 34 |
for nl in cr0 lf0 crlf0 cr1 lf1 crlf1 mix; do |
| 35 |
|
| 36 |
$_ptekf --guess saza-utf8-$nl.txt || exit 1 |
| 37 |
$_ptekf -Gj saza-utf8-$nl.txt || exit 2 |
| 38 |
mv saza-utf8-$nl.txt.out saza-utf8-$nl-jis.txt |
| 39 |
$_ptekf -Ge saza-utf8-$nl.txt || exit 3 |
| 40 |
mv saza-utf8-$nl.txt.out saza-utf8-$nl-euc.txt |
| 41 |
$_ptekf -Gs saza-utf8-$nl.txt || exit 4 |
| 42 |
mv saza-utf8-$nl.txt.out saza-utf8-$nl-sjis.txt |
| 43 |
|
| 44 |
|
| 45 |
for enc in jis euc sjis; do |
| 46 |
|
| 47 |
$_ptekf -Gu saza-utf8-$nl-$enc.txt || exit 21 |
| 48 |
mv saza-utf8-$nl-$enc.txt.out saza-utf8-$nl-$enc-utf8.txt |
| 49 |
diff saza-utf8-$nl.txt saza-utf8-$nl-$enc-utf8.txt || exit 22 |
| 50 |
|
| 51 |
done |
| 52 |
|
| 53 |
done |
| 54 |
|
| 55 |
$_ptekf --guess saza-utf8-*-jis.txt || exit 51 |
| 56 |
$_ptekf --guess saza-utf8-*-euc.txt || exit 52 |
| 57 |
$_ptekf --guess saza-utf8-*-sjis.txt || exit 53 |
| 58 |
$_ptekf --guess saza-utf8-*-*-utf8.txt || exit 54 |