3 module ActiveSupport
#:nodoc:
4 module CoreExtensions
#:nodoc:
6 # Custom string iterators
8 def self.append_features(base
)
9 super unless '1.9'.respond_to
?(:each_char)
12 # Yields a single-character string for each character in the string.
13 # When $KCODE = 'UTF8', multi-byte characters are yielded appropriately.
15 scanner
, char
= StringScanner
.new(self), /./mu
16 while c
= scanner
.scan(char
)