Project

General

Profile

Actions

Bug #2954

closed

wrong result of nkf with --numchar-input

Added by nobu (Nobuyoshi Nakada) almost 15 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
ruby -v:
1.9.2dev (2010-03-13 trunk 26898)
Backport:
[ruby-dev:40607]

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


Related issues 1 (0 open1 closed)

Related to Backport186 - Backport #2953: nkf segfaults with --numchar-inputClosedwyhaines (Kirk Haines)03/13/2010Actions
Actions #1

Updated by naruse (Yui NARUSE) almost 15 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

Actions

Also available in: Atom PDF

Like0
Like0