Instantly share code, notes, and snippets.

Embed
What would you like to do?
io = SyncIO::File.open(fd: fd, mode: mode, flags: flags)
# +io+ reads/writes bytes
file = IO::Transcoder.new(io: io, encoding: Encodings::UTF16LE)
string = file.gets
puts string.encoding # => UTF16LE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment