From: "Zachary P. Landau" Date: 2004-03-17T10:54:40+09:00 Subject: Re: Iconv::IllegalSequence raised --k3qmt+ucFURmlhDS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 17, 2004 at 10:49:57AM +0900, Zachary P. Landau wrote: >=20 > Hello, >=20 > I'm having some problems with iconv. I'm trying to convert (as an > example) http://www.atame.org/a/abel_velazquez/ from iso-8859-1 to utf8. > If I use this on the command line: 'iconv -f iso-8859-1 -t utf8 > index.html' it works fine. But the following code: >=20 > require 'open-uri' > require 'iconv' >=20 > open("http://www.atame.org/a/abel_velazquez/") do |f| > puts Iconv.conv("iso-8859-1", "utf8", f.read) > end >=20 > returns: >=20 > iconv.rb:7:in `conv': "\341zquez\n "... (Iconv::IllegalSequence) >=20 > I'm not sure why this would be. This is on ruby 1.8.1 (2004-02-06) [i686-= linux-gnu] > I had dblack try it and he got the same result. Oy nevermind. dblack informed me that it should have been Iconv.conv("utf8", "iso-8859-1", f.read) not the other way around.=20 -- Zachary P. Landau GPG: gpg --recv-key 0x24E5AD99 | http://kapheine.hypa.net/kapheine.asc --k3qmt+ucFURmlhDS Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFAV68cCwWyMCTlrZkRAk9LAJ4p53G8MaN1cKirORt4AvNGKaxcywCfVay+ hHSYe6LxtjhmBWUc7YVlxAo= =O2rz -----END PGP SIGNATURE----- --k3qmt+ucFURmlhDS--