Bug #8496

String#b does not check the code range properly

Added by Akinori MUSHA 11 months ago. Updated 11 months ago.

[ruby-core:55315]
Status:Closed
Priority:Normal
Assignee:Yui NARUSE
Category:M17N
Target version:2.1.0
ruby -v:ruby 2.1.0dev (2013-06-05 trunk 41090) [x86_64-freebsd9] Backport:1.9.3: UNKNOWN, 2.0.0: UNKNOWN

Description

Currently "abc".b.ascii_only? returns false, which should be true.

0001-string.c-String-b-Check-the-code-range-so-ascii_only.patch Magnifier (1.67 KB) Akinori MUSHA, 06/05/2013 09:35 PM

Associated revisions

Revision 41092
Added by Akinori MUSHA 11 months ago

  • string.c (String#b): Allow code range scan to happen later so ascii_only? on a result string returns the correct value. [Bug #8496]

History

#1 Updated by Akinori MUSHA 11 months ago

A patch is attached.

This problem also applies to ruby20_0.

#2 Updated by Yui NARUSE 11 months ago

coderangescan may cost too much time, so commit it with ENCCODERANGE_CLEAR(str);.

#3 Updated by Akinori MUSHA 11 months ago

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

This issue was solved with changeset r41092.
Akinori, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • string.c (String#b): Allow code range scan to happen later so ascii_only? on a result string returns the correct value. [Bug #8496]

Also available in: Atom PDF