Revert-replace characters rather than removing them

Revert- replace characters rather than removing them

Reason - It breaks with `ArgumentError: invalid byte sequence in UTF-8`

@tenderlove  - this PR is just for reference.