ahoward / systemu

univeral capture of stdout and stderr and handling of child process pid for windows, *nix, etc.
Other
126 stars 33 forks source link

ASCII-8BIT encoding #44

Open albertnetymk opened 8 years ago

albertnetymk commented 8 years ago
ruby -e ' require "systemu";  p Encoding.default_internal = Encoding.default_external; status, stdout, stderr = systemu "echo 3"; p [status, stdout.encoding, stderr]'

The result I got using ruby 2.3.1 and systemu 2.6.5 is:

#<Encoding:UTF-8>
[#<Process::Status: pid 8346 exit 0>, #<Encoding:ASCII-8BIT>, ""]

I was expecting that changing default_internal would affect the encoding used by systemu. How can I tell systemu to use utf8 by default?