lib/active_support/inflector.rb in activesupport-2.2.2 vs lib/active_support/inflector.rb in activesupport-2.2.3
- old
+ new
@@ -275,10 +275,10 @@
Iconv.iconv('ascii//ignore//translit', 'utf-8', string).to_s
end
# The iconv transliteration code doesn't function correctly
# on some platforms, but it's very fast where it does function.
- if "foo" != Inflector.transliterate("föö")
+ if "foo" != (Inflector.transliterate("föö") rescue nil)
undef_method :transliterate
def transliterate(string)
string.mb_chars.normalize(:kd). # Decompose accented characters
gsub(/[^\x00-\x7F]+/, '') # Remove anything non-ASCII entirely (e.g. diacritics).
end