capybara-mechanize icon indicating copy to clipboard operation
capybara-mechanize copied to clipboard

show me the page don't work on remote pages with non utf-8 sites

Open petRUShka opened this issue 14 years ago • 3 comments

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

petRUShka avatar Dec 22 '10 10:12 petRUShka

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

jeroenvandijk avatar Dec 22 '10 10:12 jeroenvandijk

GIST: https://gist.github.com/78b98b57ad10e42cac90

Unfortunately, this is not my service :( It's acquiring integration with bank.

petRUShka avatar Dec 22 '10 11:12 petRUShka

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.

eliotsykes avatar Nov 20 '11 17:11 eliotsykes