diff options
author | Norman Clarke <norman@njclarke.com> | 2012-01-05 17:08:27 -0300 |
---|---|---|
committer | Norman Clarke <norman@njclarke.com> | 2012-01-05 17:08:27 -0300 |
commit | 3fe7ca1dbea75ae83cd2eb868ba3f8518c0849a4 (patch) | |
tree | c2f8d0c0df58e98496a7345747f29873e6f35a78 /activesupport/lib/active_support/multibyte/chars.rb | |
parent | 51648a6fee31c9642d3ce8899a1c718e1604f4bc (diff) | |
download | rails-3fe7ca1dbea75ae83cd2eb868ba3f8518c0849a4.tar.gz rails-3fe7ca1dbea75ae83cd2eb868ba3f8518c0849a4.tar.bz2 rails-3fe7ca1dbea75ae83cd2eb868ba3f8518c0849a4.zip |
Replace Unicode.u_unpack with String#codepoints
Diffstat (limited to 'activesupport/lib/active_support/multibyte/chars.rb')
-rw-r--r-- | activesupport/lib/active_support/multibyte/chars.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/multibyte/chars.rb b/activesupport/lib/active_support/multibyte/chars.rb index 1389cb50c9..c0796320b2 100644 --- a/activesupport/lib/active_support/multibyte/chars.rb +++ b/activesupport/lib/active_support/multibyte/chars.rb @@ -153,7 +153,7 @@ module ActiveSupport #:nodoc: # 'é'.length # => 2 # 'é'.mb_chars.decompose.to_s.length # => 3 def decompose - chars(Unicode.decompose(:canonical, Unicode.u_unpack(@wrapped_string)).pack('U*')) + chars(Unicode.decompose(:canonical, @wrapped_string.codepoints.to_a).pack('U*')) end # Performs composition on all the characters. @@ -162,7 +162,7 @@ module ActiveSupport #:nodoc: # 'é'.length # => 3 # 'é'.mb_chars.compose.to_s.length # => 2 def compose - chars(Unicode.compose(Unicode.u_unpack(@wrapped_string)).pack('U*')) + chars(Unicode.compose(@wrapped_string.codepoints.to_a).pack('U*')) end # Returns the number of grapheme clusters in the string. |