From: h3raLd Date: 2007-10-23T22:45:05+09:00 Subject: Re: to_yaml and international characters On Oct 23, 3:05 pm, "Luis Parravicini" wrote: > On 10/23/07, h3raLd wrote: > > > I noticed some weird behavior when converting a string containing > > international characters to YAML: > > > irb(main):002:0> 'test עשט'.to_yaml > > => "--- \"test \\x95\\x97\\x8A\"\n" > > irb(main):003:0> > > > ...but: > > > irb(main):001:0> 'test עשט' > > => "test \225\227\212" > > \225\227\212 is the same as \x95\x97\x8A, the former in octal, and the > latter in hex. > > irb(main):002:0> 0x95.to_s(8) > => "225" > irb(main):003:0> 0x97.to_s(8) > => "227" > irb(main):004:0> 0x8a.to_s(8) > => "212" > > Bye > > -- > Luis Parravicinihttp://ktulu.com.ar/blog/ Thanks a lot, this solves part of the mystery! I figured out the other half, unfortunately: the reason why I can't view the characters in ANSI or UTF8 is because I'm inputting from DOS, which means, unfortunately, "Code Page 437" (http://en.wikipedia.org/ wiki/Code_page_437).