printf "%-40s", "CP932 to UTF-16BE :";
&test("$nkf --ic=cp932 --oc=utf-16be",$example{'ms_ucs_map_1_sjis'},$example{'ms_ucs_map_1_utf16_ms'});
-# X0201 \e$B2>L>\e(B
+# X0201 仮名
# X0201->X0208 conversion
# X0208 aphabet -> ASCII
-# X0201 \e$BAj8_JQ49\e(B
+# X0201 相互変換
print "\nX0201 test\n\n";
&test("$nkf -jZ",$example{'x0201.euc'},$example{'x0201.x0208'});
printf "%-40s", "X0201 conversion: UTF8";
&test("$nkf -jZ",$example{'x0201.utf'},$example{'x0201.x0208'});
+printf "%-40s", "-wZ"; &test("$nkf -wZ",
+ "\xE3\x80\x80\xEF\xBD\x81\xEF\xBC\xA1&\xE3\x82\xA2",
+ "\xE3\x80\x80aA&\xE3\x82\xA2");
+printf "%-40s", "-wZ0"; &test("$nkf -wZ0",
+ "\xE3\x80\x80\xEF\xBD\x81\xEF\xBC\xA1&\xE3\x82\xA2",
+ "\xE3\x80\x80aA&\xE3\x82\xA2");
+printf "%-40s", "-wZ1"; &test("$nkf -wZ1",
+ "\xE3\x80\x80\xEF\xBD\x81\xEF\xBC\xA1&\xE3\x82\xA2",
+ " aA&\xE3\x82\xA2");
+printf "%-40s", "-wZ2"; &test("$nkf -wZ2",
+ "\xE3\x80\x80\xEF\xBD\x81\xEF\xBC\xA1&\xE3\x82\xA2",
+ " aA&\xE3\x82\xA2");
+printf "%-40s", "-wZ3"; &test("$nkf -wZ3",
+ "\xE3\x80\x80\xEF\xBD\x81\xEF\xBC\xA1&\xE3\x82\xA2",
+ "\xE3\x80\x80aA&\xE3\x82\xA2");
+printf "%-40s", "-wZ4"; &test("$nkf -wZ4",
+ "\xE3\x80\x80\xEF\xBD\x81\xEF\xBC\xA1&\xE3\x82\xA2",
+ "\xE3\x80\x80aA&\xEF\xBD\xB1");
# -x means X0201 output
printf "%-40s", "X0201 output: SJIS";
&test("$nkf -xs",$example{'x0201.euc'},$example{'x0201.sjis'});
printf "%-40s", "test_data/bugs10904";
&test("$nkf -Mj",$example{'test_data/bugs10904'},$example{'test_data/bugs10904.ans'});
+printf "%-40s", "test_data/ruby-dev:39722";
+ &test("$nkf -Mj",<<eom,<<eom);
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaあ
+eom
+=?US-ASCII?Q?aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa?=
+ =?US-ASCII?Q?aaaaaaaaaaaaaaaaa?= =?ISO-2022-JP?B?GyRCJCIbKEI=?=
+eom
+# test_data/bug19779
+
+$example{'test_data/bug19779'} = unpack('u',<<'eofeof');
+2&R1","$;*$(*&R1"7V8;*$(*
+eofeof
+
+$example{'test_data/bug19779.ans'} = unpack('u',<<'eofeof');
+M/3])4T\M,C`R,BU*4#]"/T=Y4D--0T5B2T5)/3\]"CT_25-/+3(P,C(M2E`_
+10C]'>5)#6#)98DM%23T_/0H`
+eofeof
+
+printf "%-40s", "test_data/bug19779 ";
+ &test("$nkf -jM",$example{'test_data/bug19779'},$example{'test_data/bug19779.ans'});
+
if (!NKF) {
printf "%-40s", "Guess NL";
&command_tests(