Page 1 of 1

write unicodestring not correct

Posted: Mon Sep 13, 2010 5:56 am
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??

Re: write unicodestring not correct

Posted: Mon Sep 13, 2010 7:05 am
by larsa
Hello

I can't reproduce this.

Anyway, don't use AsWideString, it's only for backward compability. Use AsString instead.

Re: write unicodestring not correct

Posted: Mon Sep 13, 2010 8:09 am
by mustapha.wang
I use asstring still got this error.

My OS is windows XP chinese edition.

Re: write unicodestring not correct

Posted: Fri Oct 08, 2010 7:17 am
by mustapha.wang
Hello,do you reproduced?

Re: write unicodestring not correct

Posted: Wed Nov 10, 2010 6:57 am
by mustapha.wang
Hello,did you reproduced??

Re: write unicodestring not correct

Posted: Mon Nov 15, 2010 1:20 pm
by larsa
Hello

Windows XP is not unicode, so you must first convert your text to unicode.