j3lzza
Last Updated: February 25, 2016
·
1.284K
· renegr
E9b552afa0ff42c9677153cf4b9327e8

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
Say Thanks
Respond