Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
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?
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.
CDATA
+
/
a-z
A-Z
0-9
Add a comment
Base64 only uses alphanumeric characters and '+' (plus), '/' (slash) and '=' (equals). No need to encode anything for XML.
There are no characters whatsoever in the Base64 charset that will conflict with XML strings.
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.