From: Aaron Patterson Date: 2010-05-11T05:38:35+09:00 Subject: Re: puts bug? --NzB8fVQJ5HfG6fxh Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 11, 2010 at 03:09:47AM +0900, Roger Pack wrote: > With this file: >=20 > # coding: UTF-8 > puts "asdf=D0=9C=D0=B8=D0=BA=D0=B8=D0=BC=D0=B0=D1=83=D1=81" >=20 > output in windows is: >=20 > C:\dev\digitalarchive_trunk>ruby -v go.rb > ruby 1.9.3dev (2010-05-11 trunk 27724) [i386-mingw32] > asdf=E2=95=A8=C2=A3=E2=95=A8=E2=95=95=E2=95=A8=E2=95=91=E2=95=A8=E2=95=95= =E2=95=A8=E2=95=9D=E2=95=A8=E2=96=91=E2=95=A4=C3=A2=E2=95=A4=C3=BC >=20 >=20 > Is this expected? Does your shell support UTF-8? > Also shouldn't the following code fail? >=20 > "asdf=D0=9C=D0=B8=D0=BA=D0=B8=D0=BC=D0=B0=D1=83=D1=81".force_encoding "IB= M437" >=20 > (it doesn't) Why would it fail? You're just associating (by force) the encoding IBM437 with some bag of bytes. Because you're using force_encoding(), whether or not those bytes represent valid characters in IBM437 is up to you. --=20 Aaron Patterson http://tenderlovemaking.com/ --NzB8fVQJ5HfG6fxh Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (Darwin) iQEcBAEBAgAGBQJL6G6RAAoJEJUxcLy0/6/GH28H+wU3RDoe5h09brQ/eWz9h4/4 yMRNJvqJYUMeKOw94WtyY88MAKZu0mbDGrmU50yS3UKU4ENJ6QVdbAeUIWE3ESfm sbHfjmJA5GeZS5c7bcJun1Jd24wNOMyUSmHNiMmfQpCq/qANKmCUJeIX9F5ec/kG pcfdOrYuvF9RPiVqcEugnvZVSWWGKzjlx2DOWhn6jOUvlPP/vxo+2VakVRPWiXzb mAhFFEr0c6inKeGnSGAdtTmUPqO449oXl+Xe26V5pzTj3TxZTL5IpHlFgvSVLFoa IFaGG/qqLkrbxLqQWfQw5W4UO6WJe9a1xedyI7MsSdoXoKSVTbPIfWPEvz9ywwY= =RuMG -----END PGP SIGNATURE----- --NzB8fVQJ5HfG6fxh--