[MacRuby-devel] [MacRuby] #339: YAML error with UTF-16 string

MacRuby ruby-noreply at macosforge.org
Sat Nov 14 06:44:00 PST 2009


#339: YAML error with UTF-16 string
---------------------------+------------------------------------------------
 Reporter:  dev@…          |        Owner:  lsansonetti@…        
     Type:  defect         |       Status:  closed               
 Priority:  critical       |    Milestone:  MacRuby 0.5          
Component:  MacRuby        |   Resolution:  fixed                
 Keywords:  YAML encoding  |  
---------------------------+------------------------------------------------

Comment(by jazzbox@…):

 {{{
 $ 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/>



More information about the MacRuby-devel mailing list