From: nobu@... Date: 2004-10-04T11:53:02+09:00 Subject: [ruby-dev:24419] Re: new NKF2拡張ライブラリ なかだです。 At Mon, 4 Oct 2004 11:07:40 +0900, nobu@ruby-lang.org wrote in [ruby-dev:24418]: > $ echo -en '\377\376a\000z\0000\0009\000B0\2230\2420\3630\234NUq' | > >> ./nkf2.0/nkf -w16L | od -tx1z > 0000000 ff fe 61 00 7a 00 00 39 00 42 30 93 30 a2 30 f3 >..a.z..9.B0.0.0.< > 0000020 30 9c 4e 55 00 >0.NU.< > 0000025 > > とnkf2自体のバグのように見えます。 こっちはこれで直るような気がします。 Index: nkf.c =================================================================== RCS file: /cvsroot/nkf/nkf-2/nkf-utf8/nkf.c,v retrieving revision 1.30 diff -U2 -p -d -r1.30 nkf.c --- nkf-utf8/nkf.c 31 May 2004 06:39:35 -0000 1.30 +++ nkf-utf8/nkf.c 4 Oct 2004 02:49:06 -0000 @@ -2369,5 +2369,5 @@ w_iconv16(c2, c1, c0) return 0; } - if (utf16_mode == UTF16BE_INPUT) { + if (c2 != EOF && utf16_mode == UTF16BE_INPUT) { int tmp; tmp=c1; c1=c2; c2=tmp; -- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦