From: Daniel Sheppard Date: 2010-08-16T14:14:09+09:00 Subject: YAML Bug - can't round-trip a hash value with leading newlines. YAML can't round-trip the hash: {"default"=>"\r\n Monkey \r\nX"}. Shouldn't yaml use the escaped string format for any string that starts with whitespace, ie, yaml = "--- \ndefault: \"\\r\\n Monkey \\r\\nX\"" p YAML.load(yaml) => {"default"=>"\r\n Monkey \r\nX"} Below is a demonstration of this: ruby <<-EOF hash = {"default"=>"\r\n Monkey \r\nX"} yaml = YAML.dump(hash) p yaml hash2 = YAML.load(yaml) EOF "--- \ndefault: |-\n \r\n Monkey\r\n \r\n

Contact us

\n" /usr/lib/ruby/1.8/yaml.rb:133:in `load': syntax error on line 4, col 2: ` X' (ArgumentError) from /usr/lib/ruby/1.8/yaml.rb:133:in `load' from -:4 ruby -v ruby 1.8.7 (2010-06-23 patchlevel 299) [i686-linux] Same bug exists in the jruby implementation as well.