Norman Clarke
2010-Apr-12 19:49 UTC
[patch] improve reliability of Inflector.transliterate
Hello, I''d like to ask for some feedback on a patch I just submitted. The patch improves the reliability of ActiveSupport::Inflector.transliterate, which currently does not handle many characters from Danish, Swedish, Icelandic, Polish and other European languages. This is because the current code relies upon UTF-8 decomposition, but many common characters do not in fact decompose to an ASCII letter and a diacritic. Two very common examples are Scandanavian "ø" and German "ß". If you don''t speak any of the affected languages, imagine if the current method deleted all ocurrences of the letter "s" from English strings, and so generated paramater strings like: "234-aint-loui-cardinal" rather than "234-saint-louis-cardinals". In a nutshell, the difference to developers is: Inflector.parameterize("Ærøskøbing") # before patch: "rskbing" # after patch: "aeroskobing" Patch: http://gist.github.com/363923 LH ticket: https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/4374-inflectortransliterate-fails-on-many-european-characters#ticket-4374-2 Regards, Norman -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.