Source

uchardet-enhanced / testdata / runtest

Full commit
#!/bin/sh

trchardet=../libcharsetdetect/trchardet
#trchardet=../../libcharsetdetect-org/trchardet

for lang in ??
do 
  for code in $lang/*
  do 
    code="`basename $code`"
    testfile=$lang/$code/wikitop_${lang}_${code}.txt
    #echo Testing $testfile
    ucode="`echo $code | tr a-z A-Z`"
    ucode="`echo $ucode | sed -e 's/CP1/WINDOWS-1/`"

    rescode=`$trchardet < $testfile | tail -1`
    urescode="`echo $rescode | tr a-z A-Z`"

    if test X"$ucode" != X"$urescode"; then
       echo "Error: $lang $ucode  -> $urescode"
    fi

  done
done