F froggorf Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-30 #1 为什么text取出的字符串中若有中文就会有乱码? 英文则没有此问题?难道就是因为Delphi是english?
Y YoungSun Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-30 #2 我的理解,可能是因为text方式每次取出的是一个字节.
U ugvanxk Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-30 #5 s:widestring; s:=memo.text; s
R renyi Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-30 #9 就是,一个汉字占两个字节,text只取了其中的一半,当然出现乱码。
S savenight Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-30 #10 procedure TForm1.Button1Click(Sender: TObject); var s:string; destwidechar; destsize:integer; begin s:='ab我向三剑客c'; destsize:=length(s); dest:=AllocMem(destsize); StringToWideChar(s,dest,destsize); caption:=dest[6]; FreeMem(dest,destsize); end;
procedure TForm1.Button1Click(Sender: TObject); var s:string; destwidechar; destsize:integer; begin s:='ab我向三剑客c'; destsize:=length(s); dest:=AllocMem(destsize); StringToWideChar(s,dest,destsize); caption:=dest[6]; FreeMem(dest,destsize); end;
X xiao_min Unregistered / Unconfirmed GUEST, unregistred user! 2002-05-03 #13 嘻嘻,我也认为那是正解 procedure TForm1.Button1Click(Sender: TObject); var s:widestring; text:string; begin text:='a我是男的bc' ; s:=text; caption:=s[3]; end; 结果,CAPTION为“是”
嘻嘻,我也认为那是正解 procedure TForm1.Button1Click(Sender: TObject); var s:widestring; text:string; begin text:='a我是男的bc' ; s:=text; caption:=s[3]; end; 结果,CAPTION为“是”
S savenight Unregistered / Unconfirmed GUEST, unregistred user! 2002-05-03 #14 var s:widestring; text:string; begin text:='a我是男的bc' ; s:=text[4]; //愚蠢,我在这里搞错了,sorry caption:=s; end;
var s:widestring; text:string; begin text:='a我是男的bc' ; s:=text[4]; //愚蠢,我在这里搞错了,sorry caption:=s; end;