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