Project

General

Profile

This project is closed and read-only.

Actions

Backport #4869

closed

2206368128.chr(Encoding::UTF_8) fails strangely

Backport #4869: 2206368128.chr(Encoding::UTF_8) fails strangely

Added by postmodern (Hal Brodigan) over 15 years ago. Updated over 10 years ago.

Status:
Rejected
[ruby-core:36996]

Description

While testing some code which attempted to decode integers into UTF-8 characters, I noticed one number failed to decode:

2206368128.chr(Encoding::UTF_8)
# => RangeError: -2088599168 out of char range

The negative number within the exception makes me wonder if an Integer Overflow is occurring within the M17N code.

Updated by ko1 (Koichi Sasada) over 15 years ago Actions #1 [ruby-core:37004]

  • Status changed from Open to Assigned
  • Assignee set to naruse (Yui NARUSE)

Updated by nobu (Nobuyoshi Nakada) over 15 years ago Actions #2 [ruby-core:37014]

  • Status changed from Assigned to Closed

fixed.

Updated by brixen (Brian Shirai) about 15 years ago Actions #3 [ruby-core:38968]

Hi

On Sat, Jun 11, 2011 at 1:00 AM, Nobuyoshi Nakada wrote:

Issue #4869 has been updated by Nobuyoshi Nakada.

Status changed from Assigned to Closed

This issue has been marked as closed 2 months ago but 1.9.2p290 is
still showing the issue.

Did this get missed for p290 or was it planned for a later release?

$ ruby1.9.2 -v -e 'p 2206368128.chr(Encoding::UTF_8)'
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]
-e:1:in chr': -2088599168 out of char range (RangeError) from -e:1:in

'

Thanks,
Brian

fixed.

Bug #4869: 2206368128.chr(Encoding::UTF_8) fails strangely
http://redmine.ruby-lang.org/issues/4869

Author: Hal Brodigan
Status: Closed
Priority: Normal
Assignee: Yui NARUSE
Category: M17N
Target version:
ruby -v: ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]

While testing some code which attempted to decode integers into UTF-8 characters, I noticed one number failed to decode:

   2206368128.chr(Encoding::UTF_8)
   #

Updated by naruse (Yui NARUSE) about 15 years ago Actions #4 [ruby-core:38969]

  • Status changed from Closed to Assigned

Updated by naruse (Yui NARUSE) about 15 years ago Actions #5

  • Tracker changed from Bug to Backport
  • Project changed from Ruby to 12
  • Category changed from M17N to M17N
  • Assignee changed from naruse (Yui NARUSE) to yugui (Yuki Sonoda)

r31999

Updated by naruse (Yui NARUSE) over 10 years ago Actions #6

  • Status changed from Assigned to Rejected
Actions

Also available in: PDF Atom