Permalink
Browse files

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.
  • Loading branch information...
lest committed May 28, 2012
1 parent 7dd80d6 commit d64b25438a82541f781a22f42e5cee44acd57737
Showing with 1 addition and 1 deletion.
  1. +1 −1 activesupport/lib/active_support/multibyte/chars.rb
@@ -76,7 +76,7 @@ def self.consumes?(string)
#
# 'Café périferôl'.mb_chars.split(/é/).map { |part| part.upcase.to_s } # => ["CAF", " P", "RIFERÔL"]
def split(*args)
- @wrapped_string.split(*args).map { |i| i.mb_chars }
+ @wrapped_string.split(*args).map { |i| self.class.new(i) }
end
# Works like like <tt>String#slice!</tt>, but returns an instance of Chars, or nil if the string was not

0 comments on commit d64b254

Please sign in to comment.