File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / libiconv / tests / check-stateful
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 22:57:49 2012 UTC (12 years, 4 months ago) by misho
Branches: libiconv, MAIN
CVS tags: v1_14p0, v1_14, v1_13_1, HEAD
libiconv

#!/bin/sh
# Simple check of a stateful encoding.
# Usage: check-stateful SRCDIR CHARSET
srcdir="$1"
charset="$2"
set -e

# charset, modified for use in filenames.
charsetf=`echo "$charset" | sed -e 's,:,-,g'`

../src/iconv_no_i18n -f "$charset" -t UTF-8 < "${srcdir}"/"$charsetf"-snippet > tmp-snippet
cmp "${srcdir}"/"$charsetf"-snippet.UTF-8 tmp-snippet
../src/iconv_no_i18n -f UTF-8 -t "$charset" < "${srcdir}"/"$charsetf"-snippet.UTF-8 > tmp-snippet
cmp "${srcdir}"/"$charsetf"-snippet tmp-snippet
rm -f tmp-snippet
exit 0

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>