How to get a base64 of a base64 encoding inside a string?
-
I have a base 64 inside a string, but my object is a Qstring I need to take it to a QByteArray but without losing the value of base 64
example:
QString var =("b'L4m2aeeFG8vNnsFUEsBAhQDFAAAAAgAAAAhAPoTdNRkAQAANwcAABMAAAAAAAAAAAAAAAAAAAAAAFtDb250ZW50X1R5cGVzXS54bWxQSwECFAMUAAAACAAAACEA8p9J2ukAAABLAgAACwAAA' ")
QByteArray filecontent_pfo = QByteArray::fromBase64(var.toUtf8());
but at the moment this doesn't give me the wishes.
-
@Ripley said in How to get a base64 of a base64 encoding inside a string?:
QString var =("b'L4m2aeeFG8vNnsFUEsBAhQDFAAAAAgAAAAhAPoTdNRkAQAANwcAABMAAAAAAAAAAAAAAAAAAAAAAFtDb250ZW50X1R5cGVzXS54bWxQSwECFAMUAAAACAAAACEA8p9J2ukAAABLAgAACwAAA' ")
Do you mean you just need to take off the leading
b'
and trailing'
(plus spaces) and then treat that (viaQByteArray::QByteArray(const char *data, int size = -1)
if necessary, don't know if you need that, theQString
after the removal should do?) as theQByteArray
value to pass toQByteArray QByteArray::fromBase64(const QByteArray &base64)
? -
-