# \[Bug #2954\] wrong result of nkf with --numchar-input

**URL:** <https://www.ruby-forum.com/t/bug-2954-wrong-result-of-nkf-with-numchar-input/185077>\
**Category:** Development\
**Created:** [March 13, 2010, 1:26am UTC](https://www.ruby-forum.com/t/bug-2954-wrong-result-of-nkf-with-numchar-input/185077 "2010-03-13T01:26:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nobu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/e9c0ed/32.png) [@nobu](https://www.ruby-forum.com/u/nobu)\
**Post date:** [March 13, 2010, 1:26am UTC](https://www.ruby-forum.com/t/bug-2954-wrong-result-of-nkf-with-numchar-input/185077/1 "2010-03-13T01:26:29Z")

</div>

Bug #2954: wrong result of nkf with --numchar-input  
[http://redmine.ruby-lang.org/issues/show/2954](http://redmine.ruby-lang.org/issues/show/2954)

e$B5/I\<\<Te(B: Nobuyoshi N.  
e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal  
e$BC4Ev\<Te(B: Yui NARUSE, e$B%+%F%4%je(B: ext, Target version: 1.9.x  
ruby -v: 1.9.2dev (2010-03-13 trunk 26898)

Bug #2953e$B$N%3!\<%I$re(B1.9e$B$G\<B9T$9$k$H6u$K$J$j$^$9!#e(B

$ ./ruby bug-2953.rb | od -tx1z  
0000000 22 22 0a 0a \>“”…\<  
0000004

nkf\_buf\_t-\>ptre$B$Oe(Bnkf\_chare$B$NG[Ns$G$9$,!"e(Bnkf\_buf\_pop()e$B$Oe(Bunsigned  
chare$B$K$J$C$F$k$?$a$K:G2\<0L%P%$%H0J30$O\<N$F$i$l$F$7$^$$$^$9!#e(B

e$B$3$l$re(Bnkf\_chare$B$rJV$9$h$&$K$7$F$b!“e(B”\xe2\xa0\xae\x9f"e$B$H$$$&$\*$+$7e(B  
e$B$J7k2L$K$J$j$^$9!#e(Bstd\_getc()e$B$Ge(Bnkf\_buf\_pop()e$B$He(Bgetc()e$B$,F1Ns$K$J$Ce(B  
e$B$F$$$k$"$?$j$,LdBj$N$h$&$J5$$,$7$^$9!#e(B

---

<div class="post-metadata">

**Author:** ![nobu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/e9c0ed/32.png) [@nobu](https://www.ruby-forum.com/u/nobu)\
**Post date:** [March 15, 2010, 2:47am UTC](https://www.ruby-forum.com/t/bug-2954-wrong-result-of-nkf-with-numchar-input/185077/2 "2010-03-15T02:47:45Z")

</div>

e$B%A%1%C%He(B #2954 e$B$,99?7$5$l$^$7$?!#e(B (by Yui NARUSE)

e$B%9%F!\<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B  
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

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.

* * *

[http://redmine.ruby-lang.org/issues/show/2954](http://redmine.ruby-lang.org/issues/show/2954)
