Search code examples
symbian

Symbian: How can I convert Arabic Unicode


I receive via HTTP request, a TDesC8 Unicode string in Symbian C++, when I convert it via following function it doesn't change anything

HTTP request return:

TBuf8<300>buf;
buf.Copy(_L8("\u0627\u0646\u0627 \u0645\u0639\u0627\u0643"));
HBufC* temp = CnvUtfConverter::ConvertToUnicodeFromUtf8L(buf);

How can I convert a TDesC8 Unicode to a TDes16 in human readable form for Arabic language?

I'm using Symbian C++.

Many thanks in advance.


Solution

  • line

    _LIT8(KTest, "\u0627\u0646\u0627 \u0645\u0639\u0627\u0643");  
    

    was giving me

    warning: character is out of range  
    

    As soon as I changed it to _LIT16(KTest2, "\u0627\u0646\u0627 \u0645\u0639\u0627\u0643");

    Everything compiled alright and some arabic chars were shown without any conversion. So I suppose \u0627 is already in UCS2 encoding not UTF8, no need to convert it.