Passing umlaut to system calls using jruby-1.7.4
I recently discovered that writing ...
result = `program 'Parameter mit Umlaut äü'`
... will work just fine in ruby-2, but when moving to jruby-1.7.4 it will mess up the umlaut in the parameters. The solution is pretty simple - just use IO::popen
like so:
p = IO::popen("program 'Parameter mit Umlaut äü'", :external_encoding => "UTF-8")
result = p.read
Written by René
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#