Handle when UTF encoding fails

Background

The UTF encoding sometimes fails and if it does, the string is returned.

Proposal

We should also look into actually fixing the todo listed in the code as a follow up

# TODO: Run it through the UTF-8 replacement encoder