DELPHI 7 下 TEXT檔 ANSI與UTF8互轉方式
出處:http://tw.myblog.yahoo.com/cschen99ws/article?mid=16596&prev=18175&l=f&fid=52
procedure TForm1.Button1Click(Sender: TObject); var S:string; begin with TMemoryStream.Create do try S := #$EF#$BB#$BF; Write(S[1], Length(S)); S := AnsiToUtf8(Memo1.Text); Write(S[1], Length(S)); Position := 0; SaveToFile(‘c:\temp.txt’); finally Free; end; end; procedure TForm1.Button2Click(Sender: TObject); var […]
近期留言