[MacRuby] #706: YAML output for unicode chars should be the same as Ruby1.9
#706: YAML output for unicode chars should be the same as Ruby1.9 ----------------------------+----------------------------------------------- Reporter: jazzbox@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 0.7 Component: MacRuby | Keywords: yaml ----------------------------+----------------------------------------------- MacRuby‘s to_yaml generates this {{{ $ macruby -r 'yaml' -e 'puts "Rübe".to_yaml' --- "R\xFCbe" }}} while {{{ $ ruby1.9 -r 'yaml' -e 'puts "Rübe".to_yaml' --- "R\xC3\xBCbe" }}} I think that Ruby1.9 is valid because MacRuby 0.7 now supports correct encoding of unicode and gives the same result as Ruby1.9: {{{ $ macruby -e 'p "R\xC3\xBCbe"' "Rübe" $ ruby1.9 -e 'p "R\xC3\xBCbe"' "Rübe" }}} The one-byte string (which worked in 0.6) does not work in 0.7 any longer: {{{ $ macruby -e 'p "R\xFCbe"' "R\xFCbe" $ macruby_select 0.6 -e 'p "R\xFCbe"' "Rübe" $ ruby1.9 -e 'p "R\xFCbe"' "R\xFCbe" }}} See also tickets #700 and#339 -- Ticket URL: <http://www.macruby.org/trac/ticket/706> MacRuby <http://macruby.org/>
#706: YAML output for unicode chars should be the same as Ruby1.9 ----------------------------+----------------------------------------------- Reporter: jazzbox@… | Owner: lsansonetti@… Type: defect | Status: new Priority: major | Milestone: MacRuby 0.7 Component: MacRuby | Keywords: yaml ----------------------------+----------------------------------------------- Comment(by lsansonetti@…): Isn't that a dup of #339, which was closed as "behaves correctly"? We believe this is a bug in syck and that MacRuby respects the YAML spec. -- Ticket URL: <http://www.macruby.org/trac/ticket/706#comment:1> MacRuby <http://macruby.org/>
#706: YAML output for unicode chars should be the same as Ruby1.9 ----------------------------+----------------------------------------------- Reporter: jazzbox@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: major | Milestone: Component: MacRuby | Resolution: invalid Keywords: yaml | ----------------------------+----------------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => invalid * milestone: MacRuby 0.7 => -- Ticket URL: <http://www.macruby.org/trac/ticket/706#comment:2> MacRuby <http://macruby.org/>
#706: YAML output for unicode chars should be the same as Ruby1.9 ----------------------------+----------------------------------------------- Reporter: jazzbox@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: major | Milestone: Component: MacRuby | Resolution: invalid Keywords: yaml | ----------------------------+----------------------------------------------- Comment(by jazzbox@…): It's not a dup of #339 because #339 was about "last character missing in YAML output"! This was resolved, so I opened a new ticket! The short form is: {{{ $ macruby -r 'yaml' -e 'puts "Rübe".to_yaml' --- "R\xFCbe" }}} and the output should be {{{ --- "R\xC3\xBCbe" }}} like in Ruby1.9, which Vincent I. says is the reference! -- Ticket URL: <http://www.macruby.org/trac/ticket/706#comment:3> MacRuby <http://macruby.org/>
#706: YAML output for unicode chars should be the same as Ruby1.9 ----------------------------+----------------------------------------------- Reporter: jazzbox@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: major | Milestone: Component: MacRuby | Resolution: invalid Keywords: yaml | ----------------------------+----------------------------------------------- Comment(by vincent.isambart@…): Ruby 1.9 is indeed the reference for most behavior, but Syck that is used when you do require 'yaml' on 1.9 (and even 1.9) is just very bad and does not respect the YAML specs. Ruby 1.9 now also includes a new library for YAML (psych) that does not have this problem. {{{ % ruby1.9 -e 'require "psych"; p Psych.load("--- \"R\\xC3\\xBCbe\"")' "Rübe" % ruby1.9 -e 'require "psych"; p Psych.load("--- \"R\\xFCbe\"")' "Rübe" }}} In fact psych does not even escape the "ü". {{{ % ruby1.9 -e 'require "psych"; puts "Rübe".to_yaml' --- Rübe ... }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/706#comment:4> MacRuby <http://macruby.org/>
#706: YAML output for unicode chars should be the same as Ruby1.9 ----------------------------+----------------------------------------------- Reporter: jazzbox@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: major | Milestone: Component: MacRuby | Resolution: invalid Keywords: yaml | ----------------------------+----------------------------------------------- Comment(by jazzbox@…): Replying to [comment:4 vincent.isambart@…]:
In fact psych does not even escape the "ü". {{{ % ruby1.9 -e 'require "psych"; puts "Rübe".to_yaml' --- Rübe ... }}}
hey, that would be the best solution (I already suggested that in #339. I'm looking forward for psych in MacRuby (I can wait a little)... -- Ticket URL: <http://www.macruby.org/trac/ticket/706#comment:5> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby