|
|
User login
Feeds |
UTF8/unicode conversions
|
|||||
| Thu, 2005-08-18 14:52 | |
|
Can someone point me to right direction here?
I'm relatively new to symbian and this is giving me headache. I need to strip path information off from UTF8 string that is stored in unsigned char pointer but this solution doesn't seem to work. Code: RemovePath( unsigned char *aString, unsigned short &aLen ) { TPtr8 ptr8((TText8 *)aString, aLen); HBufC* hBuf16 = HBufC::NewL(aLen); TPtr ptr16(hBuf16->Des()); ptr16.Copy(ptr8); if( KErrNone != CnvUtfConverter::ConvertToUnicodeFromUtf8(ptr16, ptr8) ) return; TParse p; p.Set(ptr16, NULL, NULL); aLen = (p.NameAndExt()).Length(); CnvUtfConverter::ConvertFromUnicodeToUtf8( ptr8, p.NameAndExt() ); delete hBuf16; hBuf16 = 0; } |
|