capybara-mechanize
capybara-mechanize copied to clipboard
show me the page don't work on remote pages with non utf-8 sites
Failed with such error:
And show me the page # features/step_definitions/web_steps.rb:217
"\xD0" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)
./features/step_definitions/web_steps.rb:218:in `/^show me the page$/'
features/test_acquiring.feature:59:in `And show me the page'
Ruby 1.9, Rails 3
P.S. Sorry for long answer of previous ticket
Hmmm, this is a hard one. Is it possible for you to put the file that is requested in a gist?
And out of curiosity, which service are you testing? You're own app or a third party service like facebook?
Jeroen
GIST: https://gist.github.com/78b98b57ad10e42cac90
Unfortunately, this is not my service :( It's acquiring integration with bank.
In case this helps, I just ran into the same error when downloading the content of web pages and writing them to disk. At the point where the error was happening, forcing the encoding to UTF-8 fixed it:
dodgy_str.force_encoding('UTF-8')
Where dodgy_str is the string which can have dodgy characters in it.