diff options
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb b/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb index c6ef6ad095..6c8eb88702 100644 --- a/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb +++ b/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb @@ -162,10 +162,10 @@ module ActiveSupport::Multibyte::Handlers elsif args[0].kind_of? Range cps = u_unpack(str).slice(*args) cps.nil? ? nil : cps.pack('U*') - elsif args[0].kind_of? Numeric + elsif args.size == 1 && args[0].kind_of?(Numeric) u_unpack(str)[args[0]] else - str.slice(*args) + u_unpack(str).slice(*args).pack('U*') end end alias_method :[], :slice @@ -434,4 +434,4 @@ module ActiveSupport::Multibyte::Handlers UCD = UnicodeDatabase.new end end -end
\ No newline at end of file +end |