Use CDATA to store raw binary streams?

Robin Rodricks picture Robin Rodricks · Feb 2, 2009 · Viewed 12.4k times · Source

Instead of the overhead with saving binary as Base64, I was wondering if you could directly store double-byte binary streams into XML files, using CDATA, or commenting it out, or something?

Answer

Pete Kirkham picture Pete Kirkham · Feb 2, 2009

The Nul character ( '\0' in C ) is not valid anywhere in XML, even as an escape ( & #0; ).