Page 1 of 1

Question about Chinese and Portuguese

Posted: Tue Aug 15, 2006 4:07 am
by Guest
Hi, Lars

I'm using Windows XP traditional chinese version, delphi 6.0 and MS Office 2000 traditional chinese version.
I need to post both chinese and portuguese to excel file using the following code:

XLS.Filename := 'D:\Temp\1.xls';
XLS.Read;
XLS.Sheet[0].AsString[1,1] := '中文';
XLS.Sheet[0].AsWideString[1,2] := AnsiString('abcção');
XLS.Filename := 'D:\temp\2.xls';
XLS.Write;

After running, the chinese can be post successfully, but the portuguese is changed into 'abc誽o' no matter I use AsString or AsWideString. Can you help me?

Ken

Posted: Tue Aug 15, 2006 2:49 pm
by KenWhite
Ken,

Remove the AnsiString typecast. You're converting it basically the same way AsString would.

Posted: Wed Aug 16, 2006 2:05 am
by Guest
Dear KenWhite,

After I remove the AnsiString(), result is the same.

Ken

Posted: Wed Aug 16, 2006 7:26 am
by larsa
Hello

The text must be in unicode. The easiest way to get te unicode text is to write it in excel and the read the cell with XLSRreadWriteII. You can then use that text when writing the cells.


Lars Arvidsson