aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/multibyte/chars.rb
diff options
context:
space:
mode:
authorNorman Clarke <norman@njclarke.com>2012-01-05 17:16:35 -0300
committerNorman Clarke <norman@njclarke.com>2012-01-05 17:16:35 -0300
commit4ac056c7f46fa6961699402d0bf296dac6a02384 (patch)
tree3f3a5b842a989babfd68c39cd183c8b4f0e8993c /activesupport/lib/active_support/multibyte/chars.rb
parenta8a8dc4a691577c2d029be92c32f593d0fd7db75 (diff)
downloadrails-4ac056c7f46fa6961699402d0bf296dac6a02384.tar.gz
rails-4ac056c7f46fa6961699402d0bf296dac6a02384.tar.bz2
rails-4ac056c7f46fa6961699402d0bf296dac6a02384.zip
Use more descriptive method names
Diffstat (limited to 'activesupport/lib/active_support/multibyte/chars.rb')
-rw-r--r--activesupport/lib/active_support/multibyte/chars.rb4
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 b85c5e8bd1..a6256d0c47 100644
--- a/activesupport/lib/active_support/multibyte/chars.rb
+++ b/activesupport/lib/active_support/multibyte/chars.rb
@@ -90,7 +90,7 @@ module ActiveSupport #:nodoc:
# Example:
# 'Café'.mb_chars.reverse.to_s # => 'éfaC'
def reverse
- chars(Unicode.g_unpack(@wrapped_string).reverse.flatten.pack('U*'))
+ chars(Unicode.unpack_graphemes(@wrapped_string).reverse.flatten.pack('U*'))
end
# Limit the byte size of the string to a number of bytes without breaking characters. Usable
@@ -170,7 +170,7 @@ module ActiveSupport #:nodoc:
# 'क्षि'.mb_chars.length # => 4
# 'क्षि'.mb_chars.g_length # => 3
def g_length
- Unicode.g_unpack(@wrapped_string).length
+ Unicode.unpack_graphemes(@wrapped_string).length
end
# Replaces all ISO-8859-1 or CP1252 characters by their UTF-8 equivalent resulting in a valid UTF-8 string.