write unicodestring not correct

Questions and answers on how to use XLSReadWriteII 3/4/5.
Post Reply
mustapha.wang
Posts: 10
Joined: Thu Nov 16, 2006 7:14 am

write unicodestring not correct

Post by mustapha.wang »

in delphi2010

Write some spectial unicode useing “asWideString” like this:

procedure TForm1.Button1Click(Sender: TObject);
begin
XLSReadWriteII41.Sheets[0].AsWideString[0,0]:='ª®¥';
XLSReadWriteII41.Filename:='D:\U.xls';
XLSReadWriteII41.Write;
end;

Then,read it back useing "asWideString" like this.

procedure TForm1.Button2Click(Sender: TObject);
begin
XLSReadWriteII41.Filename:='D:\U.xls';
XLSReadWriteII41.Read;
Edit2.Text:=XLSReadWriteII41.Sheets[0].AsWideString[0,0];
end;

But,the text in Edit2 is :"a?£¤",not raw string "'ª®¥".Why??
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: write unicodestring not correct

Post by larsa »

Hello

I can't reproduce this.

Anyway, don't use AsWideString, it's only for backward compability. Use AsString instead.
Lars Arvidsson, Axolot Data
mustapha.wang
Posts: 10
Joined: Thu Nov 16, 2006 7:14 am

Re: write unicodestring not correct

Post by mustapha.wang »

I use asstring still got this error.

My OS is windows XP chinese edition.
mustapha.wang
Posts: 10
Joined: Thu Nov 16, 2006 7:14 am

Re: write unicodestring not correct

Post by mustapha.wang »

Hello,do you reproduced?
mustapha.wang
Posts: 10
Joined: Thu Nov 16, 2006 7:14 am

Re: write unicodestring not correct

Post by mustapha.wang »

Hello,did you reproduced??
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: write unicodestring not correct

Post by larsa »

Hello

Windows XP is not unicode, so you must first convert your text to unicode.
Lars Arvidsson, Axolot Data
Post Reply