Hi everyone.
I have just switched from Builder 6 to Builder 2009 and have a question.
How can I write unicode string to a file?
TBytes Preamble1 = TEncoding::Unicode->GetPreamble();
UnicodeString str1("string1");
int len = TEncoding::Unicode->GetByteCount(str1);
FileWrite( iFile,&Preamble1[0],Preamble1.Length );
FileWrite( iFile,str1.c_str(),len );
This is what I am doing now but I guess there should be some native way.
Btw, is it OK to get Preamble once and assume that during the application lifetime it does not change? From available documentation for UnicodeString it seems that it is always UTF-16 LE