On 10/23/07, h3raLd <h3rald / gmail.com> wrote:
> I noticed some weird behavior when converting a string containing
> international characters to YAML:
>
> irb(main):002:0> 'test =F2=F9=E8'.to_yaml
> =3D> "--- \"test \\x95\\x97\\x8A\"\n"
> irb(main):003:0>
>
> ...but:
>
> irb(main):001:0> 'test =F2=F9=E8'
> =3D> "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)
=3D> "225"
irb(main):003:0> 0x97.to_s(8)
=3D> "227"
irb(main):004:0> 0x8a.to_s(8)
=3D> "212"


Bye

--=20
Luis Parravicini
http://ktulu.com.ar/blog/