JSON and XML both support UTF-8. Neither supports embedding arbitrary binary data directly, especially if that data is not valid in your current character set
You can't safely send zero bytes over XML even with UTF-8 encoding. Not in practice:
echo '<zero>�</zero>' | xmllint -
-:1: parser error : xmlParseCharRef: invalid xmlChar value 0
<zero>�</zero>
^
printf '<?xml version="1.0" encoding="utf-8"?><zero>\0</zero>' | xmllint -
-:1: parser error : Premature end of data in tag zero line 1
<?xml version="1.0" encoding="utf-8"?><zero>
^
I explained how to do it, and yet you didn't follow instructions, have done something irrelevant, and are now complaining that it doesn't work... well sucks being you, I guess.