Skip to content

Instantly share code, notes, and snippets.

@maerzbow
Created July 22, 2012 19:28
Show Gist options
  • Save maerzbow/3160811 to your computer and use it in GitHub Desktop.
Save maerzbow/3160811 to your computer and use it in GitHub Desktop.
ensure_encoding with :sniff option
input.ensure_encoding('UTF-8', :external_encoding => :sniff, :invalid_characters => :transcode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment