From: h3raLd Date: 2007-10-23T21:45:07+09:00 Subject: to_yaml and international characters Hello, 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" Basically, the to_yaml method seems to use some strange hex escape sequences which do not correspond to ANSI, UTF-8 or windows-1252... The funny part is that when I load the same string from YAML, it is displayed correctly in the console. This would be fine, except that when I tried to save it to a file the international characters are not displayed properly (or better, they are converted to the corresponding ANSI/UTF-8 characters). What's going on here? What encoding does to_yaml use to escape international characters? According to the docs it should be UTF-8, but apparently it is not. Ruby version: 1.8.6 OS: Windows XP Any ideas?