tenderlove/mechanize — Issue #180: code converter not found (UTF-8 to UTF-8,)
Author: charlesmeyer101
Created: 2012-01-01 23:43:06+00:00
State: open

I'm a newbie to Mechanize so I hope this problem is not just user error. Mechanize is not following a hidden redirect page though 'follow_meta_refresh' is set to true. To get around this I am trying to submit the form on the hidden redirect page. This results in the following error.

/Users/Charles/.rvm/gems/ruby-1.9.2-p290/gems/mechanize-2.1/lib/mechanize/util.rb:47:in `encode': code converter not found (UTF-8 to UTF-8,) (Encoding::ConverterNotFoundError)
from /Users/Charles/.rvm/gems/ruby-1.9.2-p290/gems/mechanize-2.1/lib/mechanize/util.rb:47:in `encode_to'
from /Users/Charles/.rvm/gems/ruby-1.9.2-p290/gems/mechanize-2.1/lib/mechanize/util.rb:33:in `from_native_charset'
from /Users/Charles/.rvm/gems/ruby-1.9.2-p290/gems/mechanize-2.1/lib/mechanize/form.rb:198:in `from_native_charset'
from /Users/Charles/.rvm/gems/ruby-1.9.2-p290/gems/mechanize-2.1/lib/mechanize/form.rb:192:in `block in proc_query'
from /Users/Charles/.rvm/gems/ruby-1.9.2-p290/gems/mechanize-2.1/lib/mechanize/form.rb:191:in `map'
from /Users/Charles/.rvm/gems/ruby-1.9.2-p290/gems/mechanize-2.1/lib/mechanize/form.rb:191:in `proc_query'
from /Users/Charles/.rvm/gems/ruby-1.9.2-p290/gems/mechanize-2.1/lib/mechanize/form.rb:248:in `block in build_query'
from /Users/Charles/.rvm/gems/ruby-1.9.2-p290/gems/mechanize-2.1/lib/mechanize/form.rb:247:in `each'
from /Users/Charles/.rvm/gems/ruby-1.9.2-p290/gems/mechanize-2.1/lib/mechanize/form.rb:247:in `build_query'
from /Users/Charles/.rvm/gems/ruby-1.9.2-p290/gems/mechanize-2.1/lib/mechanize/form.rb:265:in `request_data'
from /Users/Charles/.rvm/gems/ruby-1.9.2-p290/gems/mechanize-2.1/lib/mechanize.rb:1026:in `post_form'
from /Users/Charles/.rvm/gems/ruby-1.9.2-p290/gems/mechanize-2.1/lib/mechanize.rb:426:in `submit'
from /Users/Charles/.rvm/gems/ruby-1.9.2-p290/gems/mechanize-2.1/lib/mechanize/form.rb:178:in `submit'
from mech_test.rb:30:in `

'

The HTML on the page looks something like this

nI4DP+kSUWBV4il+1HA2JjmsF+lrWauQBbE3iDAUqqOcmMkieR+q3+c6Z9Wo1HIqtHT6BHisucCMGiUyPP+JL/xlPY1n7a6OYAn0D7nNOfUqvG6fMXkN9s7BMv9hT2qAaYi/CGUMETaufKnbkA+KsLeK9Us8mGI4Bt9jzDQfsJFxVAjvQ8R5MJwjOSeQa/yY4Zn0M5aIV7mg5o6etJCGQViM2C8vSzuodT5saJ+eRRUApUW3VD1wRCKMwx6SPiMkXBO6r0HonY/KILWcaJ3/KmF7AuO3pndcc91K9Ka30m80CzljqISZatL+IkKAwmTomZHCEIFPEKfG3OQGJgLaDvFw+6u8RjQU9FXSHhKh8ReSZqA2jkAYMlr7EBzLZE8Xzy/rqR38GWvog6VmYQsi8AFjVQllo0x2sG+wAtCzlV8=

My LANG is set to

LANG=en_US.UTF-8

and I am using ruby-1.9.2-p290 with Mechanize 2.1

Thanks.