aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/inflector
diff options
context:
space:
mode:
authorNorman Clarke <norman@njclarke.com>2010-05-10 10:46:37 -0300
committerJeremy Kemper <jeremy@bitsweat.net>2010-05-21 12:24:54 -0700
commitf3abc8ac36055afed9fcc902c33ee146e066d17a (patch)
tree976019d8d451c2df0adc004d00e750b56fd6f6f6 /activesupport/lib/active_support/inflector
parentad4be3d75d46a04eb7a1d5a60bdfe68356a43e8b (diff)
downloadrails-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')
-rw-r--r--activesupport/lib/active_support/inflector/transliterate.rb5
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.