Conversion from TDes8 to TDes16 and vice-versa.
Article Metadata
Sometimes we need to convert from 8-bit descriptor to 16-bit descriptor, then we use the TDes8::Copy(const TDesC16&) method to convert them to TDes16. TDes8::Copy(const TDesC16&) strips out alternate wide characters while TDes16::Copy(const TDesC8&) pads each character with a trailing zero as part of the copy operation. These methods thus form a rudimentary way of copying and converting when the character set is encoded with one byte per character and the last byte of each wide character is NULL-padded. Symbian provided class CnvUtfConverter to convert from UTF 7 to UTF 8 and vice-versa.
Header : utf.h
Lib : charconv.lib.
TBuf8<10> buffer1;
TBuf16<10> buffer2;
buffer1.AppendNum(1234);
CnvUtfConverter::ConvertToUnicodeFromUtf8(buffer2,buffer1);
buffer1.Zero();
buffer2.Zero();
buffer2.AppendNum(1234);
CnvUtfConverter::ConvertFromUnicodeToUtf8(buffer2,buffer1);

