Replace .chars with .scan(/./m)

1.8 compatible, code taken from backports gem