Quote Originally Posted by squidge View Post
You can read the binary file into memory, encode as Base64 (using QByteArray::toBase64) and then place the data into a CDATA section of the XML using QDomDocument::createCDATASection, QXmlStreamWriter::writeCDATA, or even just QXmlStreamWriter::writeCharacters.
I have similar issue.

I have a pointer to a buffer contains Binary-data .. I want to pull the values inside the buffer and encoding them before putting them in my xml format .. so I though of this:

QByteArray text;
for (int i=0; i<len_of_my_buffer; i++){
text[i] = *pointer_to_buffer[i];
}
create_xml_function(text.toBase64, "encoded data")

is this right ?