Forum: Ruby on Rails Iconv::InvalidEncoding (""ISO-8859-1"", "UTF-8")

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Cb8193c8829b6df7671124bae695dfff?d=identicon&s=25 Ariel Sch (ariel)
on 2009-06-07 16:17
Hi,


I'm having the error: Iconv::InvalidEncoding: invalid encoding
(""ISO-8859-1"", "UTF-8") when trying to post via Mechanize.

It used to work just fine, but the error appeared after (I think)
upgrading to Rails 2.3.2, Ruby 1.8.7, Mechanize 0.9.2 (I upgraded a
while ago and only now noticed the problem).

What does it mean? Is there any way to disable/bypass the error?
Any help would be much appreciated!

Thanks a lot,
Ariel
96146b7a23174e2e024c06a49f845bb8?d=identicon&s=25 Jeffrey L. Taylor (Guest)
on 2009-06-08 18:25
(Received via mailing list)
Quoting Ariel Sch <rails-mailing-list@andreas-s.net>:
>
> What does it mean? Is there any way to disable/bypass the error?
> Any help would be much appreciated!
>

Two things, try without the double quotes in the first argument (unless
this
is just a transcription error), and have you checked that there is no
invalid
codes in the input, i.e. that the input is truely ASCII or Latin-1?  I
have
similar errors but every time I've looked, it is because the source has
garble
in it.  Latin-1 but they claim it is UTF-8 (these are RSS feeds), or no
encoding info at all (perhaps some Windows encoding).

I have not figured out how to get Iconv to recover from errors; if you
do,
please post the solution here.

Jeffrey
This topic is locked and can not be replied to.