Right now we're forcing the encoding of the input string to BINARY and also setting the output streams to BINARY for reads. See:
af16f2a
To be consistent with Ruby's core IO methods we'd need to.
- Accept input in any encoding and transcode to
Encoding::default_external or a user-specified external encoding when writing to the stdin fd.
- Read data off of the stdout/stderr assuming the default
Encoding::default_external or user-specified external_encoding and transcode to the Encoding::internal_encoding.
- Add support for overriding the default external/internal encodings as options to
Child::new.
One weird thing I noticed when working on this previously is that IO#readpartial and IO#write_nonblock seem to ignore the IO object's encoding, unlike the IO#read and IO#write methods. We get BINARY encoded data out no matter what the external/internal encoding is set to. Something to look into when we fix this.
Right now we're forcing the encoding of the input string to BINARY and also setting the output streams to BINARY for reads. See:
af16f2a
To be consistent with Ruby's core IO methods we'd need to.
Encoding::default_externalor a user-specified external encoding when writing to the stdin fd.Encoding::default_externalor user-specified external_encoding and transcode to theEncoding::internal_encoding.Child::new.One weird thing I noticed when working on this previously is that
IO#readpartialandIO#write_nonblockseem to ignore the IO object's encoding, unlike theIO#readandIO#writemethods. We get BINARY encoded data out no matter what the external/internal encoding is set to. Something to look into when we fix this.