Skip to content

Instantly share code, notes, and snippets.

@ursm
Created May 15, 2017 09:59
Show Gist options
  • Save ursm/b93b16ab456af1cb44da895279562a6d to your computer and use it in GitHub Desktop.
Save ursm/b93b16ab456af1cb44da895279562a6d to your computer and use it in GitHub Desktop.
module ToUTF16LEBom
BOM = "\uFEFF".encode('UTF-16LE')
refine String do
def to_utf16le_bom
encode('UTF-16LE').prepend(BOM)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment