Removing invalid chars to avoid: invalid byte sequence in UTF-8