Skip to content

Instantly share code, notes, and snippets.

@dannguyen
Created May 10, 2011 19:24
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 dannguyen/965189 to your computer and use it in GitHub Desktop.
Save dannguyen/965189 to your computer and use it in GitHub Desktop.
Ruby 1.8.7 iconv, I always forget this
require 'iconv'
class String
def to_ascii
Iconv.iconv('ascii//ignore//translit', 'utf-8', self).to_s
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment