diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-15 07:38:52 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-15 07:38:52 +0000 |
commit | 656a20a4d3d2a18b0752fda1110b4d6569528bf2 (patch) | |
tree | ad3d74de585659e0293ca741c1fdab8b6ab2861b /activesupport/lib | |
parent | 660a696a3f5f20ccd12faaf5a989b1ace34c447b (diff) | |
download | rails-656a20a4d3d2a18b0752fda1110b4d6569528bf2.tar.gz rails-656a20a4d3d2a18b0752fda1110b4d6569528bf2.tar.bz2 rails-656a20a4d3d2a18b0752fda1110b4d6569528bf2.zip |
Multibyte: String#slice supports regexp argument. Closes #9646.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7910 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb b/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb index e4ef98f1b6..2e7e9fac3f 100644 --- a/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb +++ b/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb @@ -255,6 +255,8 @@ module ActiveSupport::Multibyte::Handlers #:nodoc: elsif args[0].kind_of? Range cps = u_unpack(str).slice(*args) cps.nil? ? nil : cps.pack('U*') + elsif args[0].kind_of? Regexp + str.slice(*args) elsif args.size == 1 && args[0].kind_of?(Numeric) u_unpack(str)[args[0]] else |