Issue #5863 has been reported by John Firebaugh.

----------------------------------------
Bug #5863: Integer#chr may return a string with multiple characters
https://bugs.ruby-lang.org/issues/5863

Author: John Firebaugh
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin10.8.0]


=begin
Is this a bug?

  256.chr("SHIFT_JIS").length #=> 2

I think so, as it means that #chr and #ord can't be treated as inverses, and is generally confusing.

If not, the documentation for #chr should be changed, as it implies that the returned string is always a single character.
=end



-- 
http://redmine.ruby-lang.org