Force UTF-8 encoding and safely replace invalid characters with ?