Comments (21)
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.
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.
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.
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.
I'm using just REE.
from capybara-webkit.
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.
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.
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.
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.
+1
Same issue here with Baltic (ā, ē, š, etc) letters.
from capybara-webkit.
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.
+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.
+1. Same thing with russian unicode. Checked with save_and_open_page
from capybara-webkit.
+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.
Maybe I fixed.
from capybara-webkit.
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.
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.
It works with latin chars, cool!
from capybara-webkit.
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.
I can confirm that @hotchpotch's branch is working with accented chars, specs that were failing now passes.
from capybara-webkit.
I pulled in the patches from the above fork and released the changes in 0.2.0.
from capybara-webkit.
Related Issues (20)
- Issue rendering modal (SweetAlert) in CapybaraWebkit HOT 5
- Unable to find css because it redirects to /login HOT 1
- Status code 0 when injecting javascript file to be loaded over HTTPS HOT 1
- Capybara::Webkit::Browser.command becomes out of sync reading @connection responses, causing JSON::ParserError HOT 1
- Deprecation warning on normalize_whitespace with capybara >= 3.0 HOT 15
- EOFError: end of file reached on qt 5.9? HOT 3
- Follow 308 redirects HOT 8
- I am getting error when bootstrap from Window to Linux machine HOT 1
- Failing to install on mac OS 10.13.6 HOT 7
- Capybara-webkit +qt5.5 fails with X Code 10 HOT 31
- Capybara README remark clarification HOT 1
- Failing to build 1.15 on Alpine while 1.14 builds fine HOT 2
- fatal: reference is not a tree: 9ba3d6ef8891e5c15dbdc9333f857b13711d4e97 HOT 2
- ~
- Unable to maximize the window HOT 3
- Consider adding flexbox troubleshooting to README
- Upgrading Capybara to latest version makes Gitlab CI fail
- -v
- Capybara::Webkit::ConnectionError: webkit_server failed to start.
- No longer maintained? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capybara-webkit.