From: Aaron Patterson Date: 2011-05-24T03:09:39+09:00 Subject: [ruby-core:36411] Re: [Ruby 1.9 - Bug #4758] yaml file not human readable when saving utf-8 --pf9I7BMVVzbSWLtt Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 24, 2011 at 02:51:16AM +0900, Eric Hodel wrote: >=20 > Issue #4758 has been updated by Eric Hodel. >=20 >=20 > This is the YAML spec, it is not a bug of ruby. See: http://www.yaml.org= /spec/1.2/spec.html Yes, it is YAML spec. However, if it's a valid UTF-8 string, I think it *should* be output as that UTF-8 string. For example: # encoding: utf-8 require 'yaml' require 'psych' p Psych.dump({ :hello =3D> '=E3=81=93=E3=82=93=E3=81=AB=E3=81=A1=E3=81=AF= =EF=BC=81'}) p YAML.dump({ :hello =3D> '=E3=81=93=E3=82=93=E3=81=AB=E3=81=A1=E3=81=AF= =EF=BC=81'}) The results are: "---\n:hello: =E3=81=93=E3=82=93=E3=81=AB=E3=81=A1=E3=81=AF=EF=BC=81\n" "--- \n:hello: \"\\xE3\\x81\\x93\\xE3\\x82\\x93\\xE3\\x81\\xAB\\xE3\\x81\\xA1\\xE3\\x81\= \xAF\\xEF\\xBC\\x81\"\n" Which seems like unexpected behavior of syck to me. To fix this, I will make Psych default for 1.9.3. --=20 Aaron Patterson http://tenderlovemaking.com/ --pf9I7BMVVzbSWLtt Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iQEcBAEBAgAGBQJN2qLbAAoJEJUxcLy0/6/G9SEH/0IC32GW0wrwBKgP0GH1FZKN dcscwbP9XPpWpWnpDV5YRtsukO3r/hp7fo54f98vThA1rM045eNDWgjB0dLZaAOQ yGSWitw6OqOnrP/QIFPl2vS7ZGhSW5y5NHpVTbLB01GCEgUptSByJPsJjXLJYWQ6 WlYn/hZlWEmn06T8aRVvpTC0cUJSiIwvEguSJ4UxMGuxaYOK0Os//hSoMGVdSD0v WKS2YdtxWgH4vs/AD4W0/35X89CuOjtM8XbpSskgo+a1dZ1e9D04rOM/y7eyMkiN zvfUHU/Tj/gbBUsDZ+X/KjLikEbM/3V+HDDp/2NfHht5legXAt+zpO9MGz/e8L0= =8AbX -----END PGP SIGNATURE----- --pf9I7BMVVzbSWLtt--