# Ignore Iconv::IllegalSequence while using Ruby WWW::Mechaniz

**URL:** <https://www.ruby-forum.com/t/ignore-iconv-illegalsequence-while-using-ruby-www-mechaniz/174205>\
**Category:** Ruby\
**Created:** [August 22, 2009, 1:41pm UTC](https://www.ruby-forum.com/t/ignore-iconv-illegalsequence-while-using-ruby-www-mechaniz/174205 "2009-08-22T13:41:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![roddik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b3f665/32.png) [@roddik](https://www.ruby-forum.com/u/roddik)\
**Post date:** [August 22, 2009, 1:41pm UTC](https://www.ruby-forum.com/t/ignore-iconv-illegalsequence-while-using-ruby-www-mechaniz/174205/1 "2009-08-22T13:41:46Z")

</div>

Hello, I’ve encountered the Iconv::IllegalSequence error on some web  
pages when using mechanize lib. Is there a way to make mechanize just  
omit ill encoded characters and return the “cut” page? TIA

---

<div class="post-metadata">

**Author:** ![roddik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b3f665/32.png) [@roddik](https://www.ruby-forum.com/u/roddik)\
**Post date:** [August 22, 2009, 3:57pm UTC](https://www.ruby-forum.com/t/ignore-iconv-illegalsequence-while-using-ruby-www-mechaniz/174205/2 "2009-08-22T15:57:14Z")

</div>

-------- Original-Nachricht --------

> Datum: Sat, 22 Aug 2009 20:41:49 +0900  
> Von: Rodion R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> An: removed\_email\_address@domain.invalid  
> Betreff: Ignore Iconv::IllegalSequence while using Ruby WWW::Mechaniz

> ## Hello, I’ve encountered the Iconv::IllegalSequence error on some web pages when using mechanize lib. Is there a way to make mechanize just omit ill encoded characters and return the “cut” page? TIA
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

Dear Rodion,

there is an IGNORE option in Iconv :

[http://groups.google.com/group/ruby-talk-google/browse\_thread/thread/96c75d3587012556](http://groups.google.com/group/ruby-talk-google/browse_thread/thread/96c75d3587012556)

Your output might (also) depend on some settings of your operating  
system,  
language locale etc.  
For instance, on Ubuntu 9.04, Ruby 1.8.7-p160, the second conversion in  
the code in the link above gives me “caff?” instead of “caff`e”, which  
is  
apparently a Ubuntu-specific thing. Look for some discussion here:

> **[ActiveState Community](https://community.activestate.com)**
>
> Community support for users of the ActiveState Platform.

Best regards,

Axel
