diff options
author | Manfred Stienstra <manfred@fngtps.com> | 2008-09-21 17:23:37 +0200 |
---|---|---|
committer | Manfred Stienstra <manfred@fngtps.com> | 2008-09-21 17:23:37 +0200 |
commit | 520c3f33c3f642ccab3a860cf5ee0b5530c7c4f1 (patch) | |
tree | abe2f018ccf92370e478a95677438ce5c6984579 /activesupport/lib/active_support/core_ext/string | |
parent | 021172208885be0c137a9d5f352f862479044e7a (diff) | |
download | rails-520c3f33c3f642ccab3a860cf5ee0b5530c7c4f1.tar.gz rails-520c3f33c3f642ccab3a860cf5ee0b5530c7c4f1.tar.bz2 rails-520c3f33c3f642ccab3a860cf5ee0b5530c7c4f1.zip |
Change all calls to String#chars to String#mb_chars.
Diffstat (limited to 'activesupport/lib/active_support/core_ext/string')
-rw-r--r-- | activesupport/lib/active_support/core_ext/string/access.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/access.rb b/activesupport/lib/active_support/core_ext/string/access.rb index 1a949c0b77..7fb21fa4dd 100644 --- a/activesupport/lib/active_support/core_ext/string/access.rb +++ b/activesupport/lib/active_support/core_ext/string/access.rb @@ -11,7 +11,7 @@ module ActiveSupport #:nodoc: # "hello".at(4) # => "o" # "hello".at(10) # => nil def at(position) - chars[position, 1].to_s + mb_chars[position, 1].to_s end # Returns the remaining of the string from the +position+ treating the string as an array (where 0 is the first character). @@ -21,7 +21,7 @@ module ActiveSupport #:nodoc: # "hello".from(2) # => "llo" # "hello".from(10) # => nil def from(position) - chars[position..-1].to_s + mb_chars[position..-1].to_s end # Returns the beginning of the string up to the +position+ treating the string as an array (where 0 is the first character). @@ -31,7 +31,7 @@ module ActiveSupport #:nodoc: # "hello".to(2) # => "hel" # "hello".to(10) # => "hello" def to(position) - chars[0..position].to_s + mb_chars[0..position].to_s end # Returns the first character of the string or the first +limit+ characters. @@ -41,7 +41,7 @@ module ActiveSupport #:nodoc: # "hello".first(2) # => "he" # "hello".first(10) # => "hello" def first(limit = 1) - chars[0..(limit - 1)].to_s + mb_chars[0..(limit - 1)].to_s end # Returns the last character of the string or the last +limit+ characters. @@ -51,7 +51,7 @@ module ActiveSupport #:nodoc: # "hello".last(2) # => "lo" # "hello".last(10) # => "hello" def last(limit = 1) - (chars[(-limit)..-1] || self).to_s + (mb_chars[(-limit)..-1] || self).to_s end end else |