Unidecoder

This library provides methods to transliterate Unicode characters to an ASCII approximation.

The functionality in this library was originally written by Russel Norris for his Stringex library. This gem is an extraction of the Unicode transliteration functionality from Stringex into a separate library with some added functionality.

The Unidecoder component of Stringex is itself a port of Sean M. Burke's Unidecode Unidecode Perl module.

Installation

gem install unidecoder

Usage

"olá, mundo!".to_ascii                 #=> "ola, mundo!"
"你好".to_ascii                        #=> "Ni Hao "
"Jürgen Müller".to_ascii               #=> "Jurgen Muller"
"Jürgen Müller".to_ascii("ü" => "ue")  #=> "Juergen Mueller"

Extra stuff

If you also install either the Unicode or Active Support gems, Unidecoder will also perform Unicode normalization before attempting to transliterate strings to ASCII.