Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Shellescaped utf-8 string misbehaving in backticks #3046
Just tried my app with JRuby 220.127.116.11.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.
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 18.104.22.168 outputs