Skip to content

Commit

Permalink
Handle every error that can come out of the Iconv branch by rescuing …
Browse files Browse the repository at this point in the history
…and returning nil

[rails#1195 state:committed]

Conflicts:

	activesupport/lib/active_support/inflector.rb
  • Loading branch information
NZKoz committed Feb 6, 2009
1 parent be4ecc2 commit 3c006d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activesupport/lib/active_support/inflector.rb
Expand Up @@ -277,7 +277,7 @@ def transliterate(string)

# 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öö")
elsif "foo" != (Inflector.transliterate("föö") rescue nil)
undef_method :transliterate
def transliterate(string)
string.mb_chars.normalize(:kd). # Decompose accented characters
Expand Down

0 comments on commit 3c006d4

Please sign in to comment.