When the charset is not set replace non UTF-8 characters

Tested this to fix issues #92 and #124. 
It's my first pull request in GitHub please let me know what I am doing wrong :)