Bug #2954
wrong result of nkf with --numchar-input
| Status: | Closed | Start date: | 03/13/2010 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 100% |
||
| Category: | ext | |||
| Target version: | 2.0.0 | |||
| ruby -v: | 1.9.2dev (2010-03-13 trunk 26898) |
Description
Bug #2953のコードを1.9で実行すると空になります。 $ ./ruby bug-2953.rb | od -tx1z 0000000 22 22 0a 0a >""..< 0000004 nkf_buf_t->ptrはnkf_charの配列ですが、nkf_buf_pop()はunsigned charになってるために最下位バイト以外は捨てられてしまいます。 これをnkf_charを返すようにしても、"\xe2\xa0\xae\x9f"というおかし な結果になります。std_getc()でnkf_buf_pop()とgetc()が同列になっ ているあたりが問題のような気がします。
Related issues
Associated revisions
* ext/nkf/nkf-utf8/nkf.c: import latest nkf. [master 9306cb0]
this also fixes [ruby-dev:40607]
History
Updated by naruse (Yui NARUSE) about 2 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r26935. Nobuyoshi, thank you for reporting this issue. Your contribution to Ruby is greatly appreciated. May Ruby be with you.