#339: YAML error with UTF-16 string
---------------------------+------------------------------------------------
Reporter: d...@… | Owner: lsansone...@…
Type: defect | Status: closed
Priority: critical | Milestone: MacRuby 0.5
Component: MacRuby | Resolution: fixed
Keywords: YAML encoding |
---------------------------+------------------------------------------------
Comment(by jazz...@…):
{{{
$ macruby -e 'require "yaml"; puts "Rübe".to_yaml'
--- "R\xFCbe"
$ ruby1.9 -e 'require "yaml"; puts "Rübe".to_yaml'
--- "R\xC3\xBCbe"
}}}
seems to work now! Macruby escpapes to UTF-16 and Ruby1.9 escapes to
UTF-8. I didn't find anything in YAML docs that describes that behaviour,
both methods seem to be correct. But ruby 1.8 fails to load the UTF-16
YAML. That is not astonishing because IMHO there is now way to guess what
is the correct escaping mode.
I think escaping is not necessary here because the encoding of input and
output is the same. This can easly be tested by
{{{
$ macruby -e 'require "yaml"; puts YAML::load "--- Rübe"'
Rübe
}}}
--
Ticket URL: <http://www.macruby.org/trac/ticket/339#comment:3>
MacRuby <http://macruby.org/>
_______________________________________________
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel