Removes invalid UTF-8 characters from text content