Feature #1835
closed0x80.chr not equal to "\x80"
Description
=begin
I suggest 0x80.chr should be equal to "\x80" regardless of locale.
Here is the current behavior:
irb(main):001:0> 0x80.chr.encoding
=> #Encoding:ASCII-8BIT
irb(main):002:0> "\x80".encoding
=> #Encoding:UTF-8
irb(main):003:0> 0x80.chr=="\80"
=> false
irb(main):004:0> h={}
=> {}
irb(main):005:0> h[0x80.chr]=1
=> 1
irb(main):006:0> h["\x80"]=2
=> 2
irb(main):007:0> h
=> {"\x80"=>1, "\x80"=>2}
=end
Updated by naruse (Yui NARUSE) over 15 years ago
- Category changed from core to M17N
- Status changed from Open to Assigned
- Assignee set to naruse (Yui NARUSE)
=begin
Why you want it. "\x80" has any special reason?
=end
Updated by phasis68 (Heesob Park) over 15 years ago
=begin
"0x80" is just an example.
It means the ASCII code in the range of 0x80-0xFF.
It is inconsistent with the case of 0x00-0x7F.
=end
Updated by naruse (Yui NARUSE) over 15 years ago
=begin
Ruby 1.9 treats 0x00-0x7F specially because 0x00-0x7F is compatible with many other encodings. (ASCII compatible encosings)
But 0x80-0xFF doesn't.
=end
Updated by naruse (Yui NARUSE) over 15 years ago
- Status changed from Assigned to Rejected
=begin
=end