diff options
author | Norman Clarke <norman@njclarke.com> | 2010-05-10 10:46:37 -0300 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-05-21 12:24:54 -0700 |
commit | f3abc8ac36055afed9fcc902c33ee146e066d17a (patch) | |
tree | 976019d8d451c2df0adc004d00e750b56fd6f6f6 /activesupport/lib/active_support/inflector/transliterate.rb | |
parent | ad4be3d75d46a04eb7a1d5a60bdfe68356a43e8b (diff) | |
download | rails-f3abc8ac36055afed9fcc902c33ee146e066d17a.tar.gz rails-f3abc8ac36055afed9fcc902c33ee146e066d17a.tar.bz2 rails-f3abc8ac36055afed9fcc902c33ee146e066d17a.zip |
Use multibyte proxy class on 1.9, refactor Unicode.
Makes String#mb_chars on Ruby 1.9 return an instance of ActiveSupport::Multibyte::Chars to work around 1.9's lack of Unicode case folding.
Refactors class methods from ActiveSupport::Multibyte::Chars into new Unicode module, adding other related functionality for consistency.
[#4594 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activesupport/lib/active_support/inflector/transliterate.rb')
-rw-r--r-- | activesupport/lib/active_support/inflector/transliterate.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/inflector/transliterate.rb b/activesupport/lib/active_support/inflector/transliterate.rb index 2344bb1bb3..bccc5425a6 100644 --- a/activesupport/lib/active_support/inflector/transliterate.rb +++ b/activesupport/lib/active_support/inflector/transliterate.rb @@ -58,8 +58,9 @@ module ActiveSupport # transliterate("Jürgen") # # => "Juergen" def transliterate(string, replacement = "?") - I18n.transliterate(Multibyte::Chars.normalize( - Multibyte::Chars.tidy_bytes(string), :c), :replacement => replacement) + I18n.transliterate(ActiveSupport::Multibyte::Unicode.normalize( + ActiveSupport::Multibyte::Unicode.tidy_bytes(string), :c), + :replacement => replacement) end # Replaces special characters in a string so that it may be used as part of a 'pretty' URL. |