[gem] Add utf8-cleaner middleware to strip invalid characters

Fixes #62