Question about Chinese and Portuguese

Questions and answers on how to use XLSReadWriteII 3/4/5.
Post Reply
Guest
Posts: 83
Joined: Tue Aug 16, 2005 6:08 pm

Question about Chinese and Portuguese

Post 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
KenWhite
Posts: 13
Joined: Mon Jan 03, 2005 8:23 pm
Contact:

Post by KenWhite »

Ken,

Remove the AnsiString typecast. You're converting it basically the same way AsString would.
Ken
Guest
Posts: 83
Joined: Tue Aug 16, 2005 6:08 pm

Post by Guest »

Dear KenWhite,

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

Ken
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Post 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
Post Reply