This page was last modified 21:33, 13 December 2007.
Base64 Encoding and Decoding
From Forum Nokia Wiki
It sometimes happen when writing connected application that you need to manipulate data in Base64, Quoted Printable or UU format. This is fairly easy with Symbian OS as three simple classes, all derivating from TImCodec, will do the job for you:
- TImCodecB64 for Base64,
- TImCodecQP for Quoted-Printable,
- TImCodecUU for UU format.
Their usage is similar and fairly simple:
#include <imcvcodc.h> void DoBase64Encoding(const TDesC8& aSourceData, TDes8& aEncodedData) { TImCodecB64 b64enc; b64enc.Initialise(); b64enc.Encode(aSourceData,aEncodedData); } void DoBase64Decoding(const TDesC8& aSourceData, TDes8& aDecodedData) { TImCodecB64 b64dec; b64dec.Initialise(); b64dec.Decode(aSourceData,aDecodedData); }
Don't forget to link against imut.lib.
Source of the contribution on NewLC
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| API's | bpyynik | General Symbian C++ | 2 | 2003-05-13 20:12 |
| 7 bit encoding | austenuk | Smart Messaging | 4 | 2003-05-19 12:26 |
| Charset encoding of outgoing E-mail messages | omerz | Symbian Networking & Messaging | 0 | 2002-05-09 11:13 |
| Midlet runs much slower on N95 than N70 | pmcquillan | Mobile Java General | 5 | 2007-11-29 16:55 |
| MMS presentation problem | shoshay | General Messaging | 2 | 2002-10-27 20:35 |
