Skip to content

Instantly share code, notes, and snippets.

@lightyrs
Created March 12, 2015 06:01
Show Gist options
  • Save lightyrs/0798e1c5d43c6d6a9268 to your computer and use it in GitHub Desktop.
Save lightyrs/0798e1c5d43c6d6a9268 to your computer and use it in GitHub Desktop.
really force utf-8 in ruby
line.encode!('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment