Bug #2954

wrong result of nkf with --numchar-input

Added by Nobuyoshi Nakada about 5 years ago. Updated about 4 years ago.

[ruby-dev:40607]
Status:Closed
Priority:Normal
Assignee:Yui NARUSE
ruby -v:1.9.2dev (2010-03-13 trunk 26898) Backport:

Description

=begin
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()が同列になっ
ているあたりが問題のような気がします。
=end

History

#1 Updated by Yui NARUSE about 5 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
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.

=end

Also available in: Atom PDF