From: NARUSE, Yui Date: Fri, 5 Nov 2004 15:39:32 +0000 (+0000) Subject: add tests for Microsoft UCS Mapping Compatible X-Git-Tag: v2_0_6_beta2~89 X-Git-Url: http://git.sourceforge.jp/view?p=nkf%2Fnkf.git;a=commitdiff_plain;h=e6836d365bba805718c7ec61a37ce1fa3b0d103c add tests for Microsoft UCS Mapping Compatible --- diff --git a/nkf_test.pl b/nkf_test.pl index 4506950..5e817f7 100644 --- a/nkf_test.pl +++ b/nkf_test.pl @@ -2,7 +2,7 @@ # # nkf test program for nkf 2.0 # -# $Id: nkf_test.pl,v 1.5 2004/11/04 02:47:37 naruse Exp $ +# $Id: nkf_test.pl,v 1.6 2004/11/05 06:39:32 naruse Exp $ # # Shinji KONO # Sun Aug 18 12:25:40 JST 1996 @@ -240,6 +240,23 @@ print "Broken JIS is safe on Normal JIS? "; $input = $example{'jis'}; &test("$nkf -Be",$input,$example{'euc'}); + +# UCS Mapping Test +print "\n\nUCS Mapping Test\n"; + +print "Shift_JIS to UTF-16\n"; +$example{'ms_ucs_map_1_sjis'} = "\x81\x60\x81\x61\x81\x7C\x81\x91\x81\x92\x81\xCA"; +$example{'ms_ucs_map_1_utf16'} = "\x30\x1C\x20\x16\x22\x12\x00\xA2\x00\xA3\x00\xAC"; +$example{'ms_ucs_map_1_utf16_ms'} = "\xFF\x5E\x22\x25\xFF\x0D\xFF\xE0\xFF\xE1\xFF\xE2"; + +print "Normal UCS Mapping : "; + &test("$nkf -w16B0 -S",$example{'ms_ucs_map_1_sjis'},$example{'ms_ucs_map_1_utf16'}); + +print "Microsoft UCS Mapping : "; + &test("$nkf -w16B0 -S --ms-ucs-map",$example{'ms_ucs_map_1_sjis'},$example{'ms_ucs_map_1_utf16_ms'}); + +print"\n"; + # X0201 仮名 # X0201->X0208 conversion # X0208 aphabet -> ASCII