Skip to content

Instantly share code, notes, and snippets.

@chuckremes
Created November 15, 2017 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuckremes/0e3c9aeb04e01b5edd5f5795a83156eb to your computer and use it in GitHub Desktop.
Save chuckremes/0e3c9aeb04e01b5edd5f5795a83156eb to your computer and use it in GitHub Desktop.
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