[MacRuby] #192: String#length and String#size do not work correctly
#192: String#length and String#size do not work correctly ----------------------------------------+----------------------------------- Reporter: vincent.isambart@… | Owner: lsansonetti@… Type: defect | Status: new Priority: critical | Milestone: Component: MacRuby | Keywords: ----------------------------------------+----------------------------------- String#length and String#size return the byte size instead of the number of characters in the string. {{{ # coding: utf-8 p 'あ'.length p 'あ'.size p 'あ'.bytesize }}} Ruby 1.9: {{{ 1 1 3 }}} MacRuby: {{{ 3 3 3 }}} For #size, the function is declared normally in string.c but for #length, you have to remove it from opt_length in insns.def. -- Ticket URL: <http://www.macruby.org/trac/ticket/192> MacRuby <http://macruby.org/>
#192: String#length and String#size do not work correctly ----------------------------------------+----------------------------------- Reporter: vincent.isambart@… | Owner: lsansonetti@… Type: defect | Status: new Priority: critical | Milestone: Component: MacRuby | Keywords: ----------------------------------------+----------------------------------- Comment(by lsansonetti@…): As of r827 {{{ $ macruby foo.rb 1 3 3 }}} Better, but still not perfect yet :-) -- Ticket URL: <http://www.macruby.org/trac/ticket/192#comment:1> MacRuby <http://macruby.org/>
#192: String#length and String#size do not work correctly ----------------------------------------+----------------------------------- Reporter: vincent.isambart@… | Owner: lsansonetti@… Type: defect | Status: new Priority: critical | Milestone: Component: MacRuby | Keywords: ----------------------------------------+----------------------------------- Comment(by lsansonetti@…): As of r2392 {{{ $ ./miniruby t.rb 1 1 2 }}} Only #bytesize is not working well. -- Ticket URL: <http://www.macruby.org/trac/ticket/192#comment:2> MacRuby <http://macruby.org/>
#192: String#length and String#size do not work correctly ----------------------------------------+----------------------------------- Reporter: vincent.isambart@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: critical | Milestone: MacRuby 0.6 Component: MacRuby | Resolution: fixed Keywords: | ----------------------------------------+----------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.6 Comment: As of r3858 {{{ $ ./miniruby -e "s='あ'; p s.length, s.size, s.bytesize" 1 1 3 }}} \o/ -- Ticket URL: <http://www.macruby.org/trac/ticket/192#comment:3> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby