[MacRuby] #1124: string.ord returns 0xFFFF for all characters 0x80 or greater in binary string

MacRuby ruby-noreply at macosforge.org
Mon Jan 24 21:18:41 PST 2011


#1124: string.ord returns 0xFFFF for all characters 0x80 or greater in binary
string
------------------------------------------+---------------------------------
 Reporter:  justin@…                      |       Owner:  lsansonetti@…        
     Type:  defect                        |      Status:  new                  
 Priority:  critical                      |   Milestone:  MacRuby 0.9          
Component:  MacRuby                       |    Keywords:                       
------------------------------------------+---------------------------------
 This problem was introduced with changeset r5054.

 Here's some test code:

 {{{
 ary = []
 "\x00\x01\x7F\x80".each_char { |c| ary << (c.ord & 0xff) }
 if ary == [0,1,127,128]
   puts "Looks good"
 else
   puts "Expected [0,1,127,128], got [#{ary.join(',')}]"
 end
 }}}

 When run on MacRuby r5053:
 {{{
 Looks good
 }}}

 When run on MacRuby r5054 through r5187:
 {{{
 Expected [0,1,127,128], got [0,1,127,255]
 }}}

 When run on CRuby 1.9.2:
 {{{
 Looks good
 }}}

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/1124>
MacRuby <http://macruby.org/>



More information about the macruby-tickets mailing list