Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Contributor
Posts: 24
Registered: ‎11-11-2013
My Device: BB 10 -BlackBerry Z10
Accepted Solution

How to encode String into base64 format

[ Edited ]

Hello ,

 

     I need to encode QString variable into base64 format.   I am new to this technology . Could anyone please tell me how should I do this?

Developer
Posts: 16,578
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: How to encrypt String into base64 format

https://developer.blackberry.com/native/reference/cascades/qbytearray.html#toBase64

(note: it is not an encryption)
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
Posts: 24
Registered: ‎11-11-2013
My Device: BB 10 -BlackBerry Z10

Re: How to encode String into base64 format

[ Edited ]

Thanks simon_hain , but it's not for QByteArray . I have QString variable which I need to encode.

Developer
Posts: 16,578
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: How to encode String into base64 format

[ Edited ]

https://developer.blackberry.com/native/reference/cascades/qstring.html#toUtf8 returns a QByteArray

or https://developer.blackberry.com/native/reference/cascades/qbytearray.html#append-2 appends a QString to an QByteArray

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
Posts: 24
Registered: ‎11-11-2013
My Device: BB 10 -BlackBerry Z10

Re: How to encode String into base64 format

Thanks a lot simon_hain......:smileyvery-happy: