Unicode doesn't allow embedded nulls in text
Ignoring everything else, this is completely wrong, in multiple ways. But for starters, embedded NULLs are just fine in Unicode/UTF-8 texts, and anything that does not support them is not fully Unicode/UTF-8 compliant.
Examples being Java and TCL which uses an overlong sequence instead of NULL bytes, which any conformant UTF-8 decoder would reject.