Skip to content

Commit d64b254

Browse files
committed
make AS::Multibyte::Chars work w/o multibyte core ext
Use ActiveSupport::Multibyte::Chars.new instead of String#mb_chars. It allows to use ActiveSupport::Multibyte::Chars without requiring String multibyte core extension.
1 parent 7dd80d6 commit d64b254

File tree

1 file changed

+1
-1
lines changed
  • activesupport/lib/active_support/multibyte

1 file changed

+1
-1
lines changed

activesupport/lib/active_support/multibyte/chars.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def self.consumes?(string)
7676
#
7777
# 'Café périferôl'.mb_chars.split(/é/).map { |part| part.upcase.to_s } # => ["CAF", " P", "RIFERÔL"]
7878
def split(*args)
79-
@wrapped_string.split(*args).map { |i| i.mb_chars }
79+
@wrapped_string.split(*args).map { |i| self.class.new(i) }
8080
end
8181

8282
# Works like like <tt>String#slice!</tt>, but returns an instance of Chars, or nil if the string was not

0 commit comments

Comments
 (0)