From: MenTaLguY Date: 2006-06-01T01:48:10+09:00 Subject: Re: [BUG] round trip failure with YAML; both ruby_1_8 and HEAD On Thu, 1 Jun 2006 00:25:26 +0900, Mauricio Fernandez wrote: > I caught syck corrupting data once again, and traced it down to this: > orig = "\n" > new = YAML.load(YAML.dump(orig)) > puts "Should be #{orig.inspect}, but is: #{new.inspect}" > puts "YAML: #{YAML.dump(orig).inspect}" Another (different, I think) roundtripping failure related to collapsing newlines is: orig = "hoge\n\nhoge" def orig.to_yaml_style ; :fold ; end new = YAML.load(YAML.dump(orig)) puts "Should be #{orig.inspect}, but is: #{new.inspect}" puts "YAML: #{YAML.dump(orig).inspect}" Which yields: Should be "hoge\n\nhoge", but is: "hoge\nhoge" YAML: "--- >-\nhoge\n\nhoge\n" It's present in ruby_1_8 as of last week, at least. -mental