hi, my friends
I write a program to put some Chinese words into the file. and I use the class RFile::write and RFile::flush to implement. But I meet a problem that is write function only get parameter of 8 bits, Chinese is composed 2 bytes. I don't know how to solve the problem.
Thank you my friends!
The belove is part of my code.
_LIT(kbuf,"");
TBuf<30> word(kbuf);
TPtrC16 ptr16( word );
//change the 16 to 8
TBuf8<60> buf8;
CCnvCharacterSetConverter* converter = CCnvCharacterSetConverter::NewLC();
RFs fs;
User::LeaveIfError(fs.Connect());
CleanupClosePushL(fs);
converter->PrepareToConvertToOrFromL(KCharacterSetIdentifierCodePage1252, fs);
User::LeaveIfError(converter->ConvertFromUnicode(buf8, ptr16));
CleanupStack::PopAndDestroy(2); // fs, converter
TInt suucess = buf8.Length();
buf8[suucess+1 ] = ';';
suucess= file->Write( buf8 );
file->Flush();