Use the Unicode replacement character instead of ? for invalid UTF8 chars.
Use String.scrub when available.
Use String.encode when String.scrub isn't available.