Defend against non-UTF8 bytes in strings being marshaled.