-
-
Notifications
You must be signed in to change notification settings - Fork 925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shellescaped utf-8 string misbehaving in backticks #3046
Comments
The shellescape method seems to be the same in 1.7.20.1 and 9.0.0.0.rc1. So it must be the backticks that is behaving differently and not treating the backslashes correctly. |
Our shellwords library is identical to that in MRI, so I think you're right...the problem isn't in shellwords. However, I was unable to reproduce your issue with my HEAD version of JRuby 9k. What platform are you on? Do you have an unusual system encoding (i.e. non-UTF-8)? |
I just installed jruby-head with rvm and tested that it reproduces. My test file content was:
This will output
My environment is Ubuntu 14.04. The same test file run with JRuby 1.7.20.1 outputs
|
Can you show me your LANG env var please? I ran on OS X and your script works ok. |
LANG=en_US.UTF-8 |
Ok, I'll give it a shot on Linux and try to reproduce. |
Just tried my app with JRuby 9.0.0.0.rc1 and noticed that shellescape is returning utf-8 characters with a couple of backslashes in front of them. And because of this the escaped string does not work with the backticks.
This is almost the same situation as in #2258 but now I'm using shellescape to sanitize the input.
In the 1.7 JRuby the shellescape was working without issues.
The text was updated successfully, but these errors were encountered: