iconv_test.sh revision 48edc7cf07b5dccc3ad84bf2dafe4150bd666d60
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
#
#
# Copyright 2012 Nexenta Systems, Inc. All rights reserved.
#
# test name, file a, file b
echo "TEST FAIL: $1"
exit 1
fi
echo "TEST PASS: $1"
}
# fromcs, tocs, in, out
}
echo '<code_set_name> one'
echo 'CHARMAP'
echo '<NULL>\t\x00'
for i in 8 9 a b c d e f
do
for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f
do
echo "<c1-$i$j>\t\x$i$j"
done
done
echo 'END CHARMAP'
}
echo '<code_set_name> two'
echo 'CHARMAP'
echo '<NULL>\t\x00'
for i in 8 9 a b c d e f
do
for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f
do
echo "<c1-$i$j>\t\x20\x$i$j"
done
done
echo 'END CHARMAP'
}
# write 1023 bytes of space
n=1023
while [[ $n -gt 0 ]]; do
echo ' \c'
((n-=1))
done
}
# two-byte utf-8 crossing 1024 byte boundary
echo '\0303\0240'
}
# one-byte 8859-1 at 1024 byte boundary
echo '\0340'
}
# Test some simple, built-in conversions
# Test user-provided charmap
# test crossing 1024 byte buffer boundary
mkbuf_utf8 > in
mkbuf_8859 > o1
exit 0