How I can store base64 strings in XML?
Do you use CDATA to store base64 strings in XML? Would it help as it allows use of < > within the strings?
Is base64 configurable where you tell it not to use certain chars if they conflict with XML?
Xml to base64 encoder tool What is a xml to base64 encoder? This tool converts an XML (Extensible Markup Language) data structure to base64 encoding. It also lets you specify the maximum encoded line length and split output into chunks, or just output it as one continous string.
Base64 is only used as a transport mechanism, not for storage. For example, you can embed a base64 encoded image into an XML document or an email message.
Base64 deals with the first block (producing 4 characters) and the second (as they are complete). But for the third, it will add a double == in the output in order to complete the 4 needed characters.
Base64 is an encoding, the strings you've posted are encoded. You can DECODE the base64 values into bytes (so just a sequence of bits). And from there, you need to know what these bytes represent and what original encoding they were represented in, if you wish to convert them again to a legible format.
You can just store it as a text or attribute value; no escaping or CDATA
sections needed. The standard base 64 characters +
and /
(other than a-z
, A-Z
and 0-9
) do not interfere with XML parsing at all.
Base64 only uses alphanumeric characters and '+' (plus), '/' (slash) and '=' (equals). No need to encode anything for XML.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With