remove malformed utf-8 characters from a file