Transliterate vs Unidecode

Martin
Fri, 16 Jan 2009 13:03:34 -0000

Hi,

I''m not entirely satisfied with the way
ActiveSupport::Inflector.transliterate works:
- "œuf" (egg in French) is transliterated into "uf" instead
of the
more logical "oeuf"
- "Straße" is transliterated into "Strae" instead of
"Strasse"
- "€" is transliterated into nothing (blank string)

The result is that you end up with meaningless URLs when you generate
them with parametrize, which uses transliterate.

The "unidecode" gem (http://rubyforge.org/projects/unidecode/) has a
different approach:
- any ligature is expanded into separate characters, "œ" is
transliterated into "oe", "ß" into "ss", etc.
- more generally, unidecode always tries to find a replacement. For
example, "€" is transliterated into "EU".

What do you think: do you prefer the transliterate approach that
ignores any fancy character or the unidecode gem that always tries to
have a meaningfull replacement?
Would it make sense to propose a patch that includes and uses the
unidecode gem for the transliterate method?


Martin