Permalink
Browse files

Handle every error that can come out of the Iconv branch by rescuing …

…and returning nil

[#1195 state:committed]

Conflicts:

	activesupport/lib/active_support/inflector.rb
  • Loading branch information...
NZKoz committed Feb 6, 2009
1 parent be4ecc2 commit 3c006d428b3d3d306185f620cce3821b1bdb636f
Showing with 1 addition and 1 deletion.
  1. +1 −1 activesupport/lib/active_support/inflector.rb
@@ -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

2 comments on commit 3c006d4

@whatcould

This comment has been minimized.

Show comment Hide comment
@whatcould

whatcould Feb 6, 2009

Hey there Koz, from here it looks like you might want to take a second look at that:
vendor/rails/activesupport/lib/active_support/inflector.rb:280: syntax error, unexpected kELSIF, expecting kEND

Hey there Koz, from here it looks like you might want to take a second look at that:
vendor/rails/activesupport/lib/active_support/inflector.rb:280: syntax error, unexpected kELSIF, expecting kEND

This comment has been minimized.

Show comment Hide comment
@ghost

ghost Feb 6, 2009

Collaborator

Fixed.

Collaborator

ghost replied Feb 6, 2009

Fixed.

Please sign in to comment.