Fixed String#count behaviour with multi-byte strings.

Fixed #2905.