[MacRuby] #602: File.dirname cuts string at wrong index with unicode strings
#602: File.dirname cuts string at wrong index with unicode strings ------------------------------------+--------------------------------------- Reporter: mark.hubbart@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: string path dirname unicode encoding utf-8 ------------------------------------+--------------------------------------- To quickly see the bug: p File.dirname "/αλφα/βετα.txt" #==> "/αλφα/βετ" Result should be "/αλφα". It looks like maybe it gets a byte index to cut at, then uses it as a character index? -- Ticket URL: <http://www.macruby.org/trac/ticket/602> MacRuby <http://macruby.org/>
#602: File.dirname cuts string at wrong index with unicode strings ------------------------------------+--------------------------------------- Reporter: mark.hubbart@… | Owner: vincent.isambart@… Type: defect | Status: new Priority: major | Milestone: Component: MacRuby | Keywords: string path dirname unicode encoding utf-8 ------------------------------------+--------------------------------------- Changes (by eloy.de.enige@…): * owner: lsansonetti@… => vincent.isambart@… Comment: String is being worked on. For now, as a workaround, you could use the Cocoa API like: {{{ p = "/αλφα/βετα.txt" puts p.stringByDeletingLastPathComponent # => "/αλφα" }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/602#comment:1> MacRuby <http://macruby.org/>
#602: File.dirname cuts string at wrong index with unicode strings --------------------------------------------------------+------------------- Reporter: mark.hubbart@… | Owner: vincent.isambart@… Type: defect | Status: closed Priority: major | Milestone: MacRuby 0.6 Component: MacRuby | Resolution: fixed Keywords: string path dirname unicode encoding utf-8 | --------------------------------------------------------+------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.6 Comment: Seems to be fixed in trunk. {{{ $ ./miniruby -e 'p File.dirname "/αλφα/βετα.txt"' "/αλφα" }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/602#comment:2> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby