Giter Club home page Giter Club logo

Comments (21)

eparreno avatar eparreno commented on September 24, 2024

Same issue with pages including latin chars encoded in utf-8.
You can change http headers with capybara or even in the controller to force utf-8 encoding instead of iso but doesn't works.

from capybara-webkit.

jferris avatar jferris commented on September 24, 2024

Which version of Ruby are you guys using? When you say that the characters turn into question marks, do you mean in save_and_open_page or somewhere else?

from capybara-webkit.

eparreno avatar eparreno commented on September 24, 2024

In my case i've tried with REE, Ruby 1.8.7 and Ruby 1.9.2 (in Mac OSX) and doesn't works in anyone of them.
As you say, save_and_open_page shows a page with wrong characters but app shows views properly. The problem is webkit renders views using iso encoding although you set headers manually and force encoding to utf8.

from capybara-webkit.

Fonsan avatar Fonsan commented on September 24, 2024

I'm having similar issues

Swedish characters like Å are turning into ?? which means click_on fails and using save_and_open_page produces the following on 1.9.2 on mac osx

 Failure/Error: save_and_open_page
 Encoding::UndefinedConversionError:
   "\xE5" from ASCII-8BIT to UTF-8

from capybara-webkit.

marocchino avatar marocchino commented on September 24, 2024

I'm using just REE.

from capybara-webkit.

ngauthier avatar ngauthier commented on September 24, 2024

I believe I have a related issue that may pinpoint this further. When I fill in an input box with a string with a space in it, the space is converted to %20, so:

"Hello World" => "Hello%20World"

Then, when I submit the form, I see the params come through as:

"Hello%25%20World"

Which indicates that it was escaped (by my JS to send along as params).

So, my guess is that you guys are escaping the content to send across the socket, but are not unescaping it. And when you escape the content, it's stripping the non-ascii characters away.

Perhaps if you can send the strings over the socket as binary data somehow? Not really sure ...

from capybara-webkit.

jferris avatar jferris commented on September 24, 2024

We're not doing anything special to escape content going across the socket, and form params don't actually go through our socket layer. They go directly from WebKit to the application.

If extra escaping is happening, it must be when setting or retrieving form values. I'll see if I can reproduce this and get to the bottom of it, but if somebody else is curious, I think the Node commands for set and value are the place to start looking.

from capybara-webkit.

ngauthier avatar ngauthier commented on September 24, 2024

Yeah, I realize webkit goes straight to the app, which is why I assumed it was escaping to cross the socket. I see now you are writing directly.

When I set the value using #fill_in then retrieve it with #value it is correct. Not sure what it is then!

from capybara-webkit.

carlosantoniodasilva avatar carlosantoniodasilva commented on September 24, 2024

I'm running into the same issue here. All specs are green using Webdriver + Chrome. When running with capybara-webkit, some of them fail on has_content? matchers due to this issue, and inspecting the page returns me the ? chars. Using REE, capybara 0.4.1.2, capybara-webkit 0.1.6, on Mac OSX.

from capybara-webkit.

osegrums avatar osegrums commented on September 24, 2024

+1
Same issue here with Baltic (ā, ē, š, etc) letters.

from capybara-webkit.

pascal-za avatar pascal-za commented on September 24, 2024

I can replicate this problem anywhere by simply putting & copy; (without the space obviously) anywhere in the page HTML and calling save_and_open_page

from capybara-webkit.

rodrigotassinari avatar rodrigotassinari commented on September 24, 2024

+1, my apps texts are in portuguese, all accented characters are show as question marks when using the webkit driver. this is visible with save_and_open_page and also on simple content checks, like:

Failure/Error: find('.field_errors_detail').text.should == 'Este campo é obrigatório.'
  expected: "Este campo é obrigatório."
       got: "Este campo ? obrigat?rio." (using ==)

from capybara-webkit.

dapi avatar dapi commented on September 24, 2024

+1. Same thing with russian unicode. Checked with save_and_open_page

from capybara-webkit.

colszowka avatar colszowka commented on September 24, 2024

+1 on this, clicking links or verifying seen content that has german umlauts (i.e. "Möwenhirn") fails for me too. When removing the special chars from the operation "..,follow 'wenhirn'", it works fine.

Edit: I'm on 1.8.7-p334 here, but from what others wrote this doesn't seem to be important.

from capybara-webkit.

hotchpotch avatar hotchpotch commented on September 24, 2024

Maybe I fixed.

from capybara-webkit.

colszowka avatar colszowka commented on September 24, 2024

I gave it a spin by adding hotchpotch's fork as the git path for the gem in my gemfile, didn't help, still getting 'no link with title, id or text '...''

from capybara-webkit.

colszowka avatar colszowka commented on September 24, 2024

Just wanted to report that after another fix by hotchpotch on his fork, gem 'capybara-webkit', :git => 'https://github.com/hotchpotch/capybara-webkit.git' now makes links/text with german umlauts work smoothly!

Please pull in those fixes and push a new version to gemcutter.

from capybara-webkit.

eparreno avatar eparreno commented on September 24, 2024

It works with latin chars, cool!

from capybara-webkit.

osegrums avatar osegrums commented on September 24, 2024

With https://github.com/hotchpotch/capybara-webkit.git all my tests with Baltic letters now pass too.
This solution works for me. Tnx

from capybara-webkit.

carlosantoniodasilva avatar carlosantoniodasilva commented on September 24, 2024

I can confirm that @hotchpotch's branch is working with accented chars, specs that were failing now passes.

from capybara-webkit.

jferris avatar jferris commented on September 24, 2024

I pulled in the patches from the above fork and released the changes in 0.2.0.

from capybara-webkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.