Skip to content

Instantly share code, notes, and snippets.

@selvakn
Created October 10, 2009 17:58
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 selvakn/206984 to your computer and use it in GitHub Desktop.
Save selvakn/206984 to your computer and use it in GitHub Desktop.
Tranliterate with ActiveSupport String extension.
# Tranliterate with ActiveSupport String extension.
"Gévry".mb_chars.normalize(:d).split(//u).reject { |e| e.length > 1 }.join
#=> "Gevry"
# From ActiveSupport 2.3
ActiveSupport::Inflector.transliterate("Gévry").to_s
#=> "Gevry"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment