Project

General

Profile

Backport #5890

Please backport r34236

Added by john_firebaugh (John Firebaugh) almost 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
[ruby-core:42097]

Description

This revision resolves the following issues:

inconsistent treatment of 8 bit characters in US-ASCII (http://bugs.ruby-lang.org/issues/5855)
Integer#chr may return a string with multiple characters (http://bugs.ruby-lang.org/issues/5863)
Integer#chr raises on some invalid codepoints but returns an invalidly-encoded string for others (http://bugs.ruby-lang.org/issues/5864)


Related issues

Related to Backport193 - Backport #5878: compile error in string.c:2096 since r34236Closed01/11/2012Actions

Associated revisions

Revision e0f8351d
Added by naruse (Yui NARUSE) almost 8 years ago

merge revision(s) 34236: [Backport #5890]

    * numeric.c (rb_enc_uint_char): raise RangeError when added codepoint
      is invalid. [Feature #5855] [Bug #5863] [Bug #5864]

    * string.c (rb_str_concat): ditto.

    * string.c (rb_str_concat): set encoding as ASCII-8BIT when the string
      is US-ASCII and the argument is an integer greater than 127.

    * regenc.c (onigenc_mb2_code_to_mbclen): rearrange error code.

    * enc/euc_jp.c (code_to_mbclen): ditto.

    * enc/shift_jis.c (code_to_mbclen): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 34501
Added by naruse (Yui NARUSE) almost 8 years ago

merge revision(s) 34236: [Backport #5890]

* numeric.c (rb_enc_uint_char): raise RangeError when added codepoint
  is invalid. [Feature #5855] [Bug #5863] [Bug #5864]

* string.c (rb_str_concat): ditto.

* string.c (rb_str_concat): set encoding as ASCII-8BIT when the string
  is US-ASCII and the argument is an integer greater than 127.

* regenc.c (onigenc_mb2_code_to_mbclen): rearrange error code.

* enc/euc_jp.c (code_to_mbclen): ditto.

* enc/shift_jis.c (code_to_mbclen): ditto.

History

#1

Updated by naruse (Yui NARUSE) almost 8 years ago

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

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


merge revision(s) 34236: [Backport #5890]

* numeric.c (rb_enc_uint_char): raise RangeError when added codepoint
  is invalid. [Feature #5855] [Bug #5863] [Bug #5864]

* string.c (rb_str_concat): ditto.

* string.c (rb_str_concat): set encoding as ASCII-8BIT when the string
  is US-ASCII and the argument is an integer greater than 127.

* regenc.c (onigenc_mb2_code_to_mbclen): rearrange error code.

* enc/euc_jp.c (code_to_mbclen): ditto.

* enc/shift_jis.c (code_to_mbclen): ditto.

Also available in: Atom PDF