Project

General

Profile

Bug #8496

String#b does not check the code range properly

Added by Akinori MUSHA almost 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
ruby -v:
ruby 2.1.0dev (2013-06-05 trunk 41090) [x86_64-freebsd9]
[ruby-core:55315]

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 almost 3 years 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]

Revision 41092
Added by Akinori MUSHA almost 3 years 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]

Revision 41092
Added by Akinori MUSHA almost 3 years 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 [ruby-core:55317] Updated by Akinori MUSHA almost 3 years ago

A patch is attached.

This problem also applies to ruby_2_0_0.

#2 [ruby-core:55319] Updated by Yui NARUSE almost 3 years ago

coderange_scan may cost too much time, so commit it with ENC_CODERANGE_CLEAR(str);.

#3 Updated by Akinori MUSHA almost 3 years 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