Am 27.05.2013 21:05, schrieb Bryan Lockwood:
>  From my point of view, one of the advantages of YAML files is that they're easy to read and edit using normal text editors,
> and don't have all the excess cruft of XML files; yet working with Chinese vocabulary lists has revealed some odd behavior.
>
> Here's my program and it's output:
>
> Is there some way to get the output I would like to see. The output of yaml is not readable by humans, and I can't verify it much
> less change it.
[...]

Do you need to use 1.9.2?

Since 1.9.3 and its new default YAML engine "psych", strings encoded
in UTF-8 should be dumped as UTF-8.

If upgrading to 1.9.3 or 2.0 is no option, set "psych" explicitly
(you probably will need to install the "psych" gem first) with

     require 'yaml'
     YAML::ENGINE.yamler='psych'
     ...

or try searching with "utf-8 yaml ruby" for workarounds.


> 1.9.2
> ---
> "\xE6\x88\x91": "w\xC7\x92"
> "\xE4\xBD\xA0": "n\xC7\x90"
> -------------------------
> # This is what I would prefer to see
> ---
> : w
> : n
>


-- 
<https://github.com/stomar/>