From: NARUSE, Yui Date: Thu, 22 Nov 2012 07:13:03 +0000 (+0900) Subject: Fix JIS X 0201 decode [nkf-bug#30162] X-Git-Tag: v2_1_3~10 X-Git-Url: http://git.osdn.net/view?p=nkf%2Fnkf.git;a=commitdiff_plain;h=d844277c5702758dcd8ef9603a2db5fd4996885c Fix JIS X 0201 decode [nkf-bug#30162] patched by deton. http://sourceforge.jp/ticket/browse.php?group_id=248&tid=30162 --- diff --git a/nkf.c b/nkf.c index a16b142..89c4643 100644 --- a/nkf.c +++ b/nkf.c @@ -5683,6 +5683,7 @@ kanji_convert(FILE *f) else if (c1 == 'I') { /* JIS X 0201 Katakana */ set_input_mode(JIS_X_0201_1976_K); + shift_mode = 1; SKIP; } else if (c1 == 'B' || c1 == 'J' || c1 == 'H') { diff --git a/nkf_test.pl b/nkf_test.pl index 79cfea6..7279cd2 100644 --- a/nkf_test.pl +++ b/nkf_test.pl @@ -527,6 +527,17 @@ printf "%-40s", "X0201 output: EUC"; &test("$nkf -xe",$example{'x0201.jis'},$example{'x0201.euc'}); printf "%-40s", "X0201 output: UTF8"; &test("$nkf -xw",$example{'x0201.jis'},$example{'x0201.utf'}); +# test_data/x0201jis= + +$example{'test_data/x0201jis=.ans'} = unpack('u',<<'eofeof'); +MH:*CI*6FIZBIJJNLK:ZOL+&RL[2UMK>XN;J[O+V^O\#!PL/$Q<;'R,G*R\S- +2SL_0T=+3U-76U]C9VMO?\@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\x1b(B", + $example{'test_data/x0201jis=.ans'}); # MIME decode