mqssave/test-charset.sh
2009-01-05 17:29:19 +00:00

50 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
function file_load
{
out="$1"
in="$2"
cc="$3"
cs="$4"
echo -n "CC: [$cc] CS: [$cs] $(cat $in)" >$$.tmp
mqsload -mb '\n---\n' $cc -cs $cs $out $$.tmp
\rm $$.tmp
}
function file_save
{
out="$1"
in="$2"
cc="$3"
cs="$4"
cm="$5"
mqssave -mb '\n---\n' $cc -cs $cs $cm -bem $out $in
}
file_load DLQ test-charset-in-utf "-cc" 1208
file_load DLQ test-charset-in-utf "-cc" 819
file_load DLQ test-charset-in-iso "-cc" 1208
file_load DLQ test-charset-in-iso "-cc" 819
file_load DLQ test-charset-in-utf " " 1208
file_load DLQ test-charset-in-utf " " 819
file_load DLQ test-charset-in-iso " " 1208
file_load DLQ test-charset-in-iso " " 819
\rm test-charset-out-cc-utf test-charset-out-cc-iso test-charset-out-__-utf test-charset-out-__-iso
file_save test-charset-out-cc-utf DLQ "-cc" 1208 "-cm"
file_save test-charset-out-cc-iso DLQ "-cc" 819 "-cm"
file_save test-charset-out-__-utf DLQ " " 1208 "-cm"
file_save test-charset-out-__-iso DLQ " " 819 " "