Quote Originally Posted by d_stranz View Post
No. A QByteArray is created empty with no size, so accessing text[ i ] on an empty array will cause a crash. Do this:

Qt Code:
  1. QByteArray text64 = QByteArray::fromRawData( pointer_to_buffer, len_of_my_buffer ).toBase64();
  2. create_xml_function( text64, "encoded_data" ); // spaces not allowed in XML tags!
To copy to clipboard, switch view to plain text mode 

Of course, you will want to add some error checking...
Thanks, it works now and I am passing it to my xml. you were right, my Qbytearray was "empty with no size"