使用 idHTTP 获取 UTF-8 编码的中文网页 - 回复同学 "Delphi学习者" 的问题
作者:互联网
使用 idHTTP 获取 UTF-8 编码的中文网页 - 回复同学 "Delphi学习者" 的问题
uses IdHTTP; const Url = 'http://del.cnblogs.com'; procedure TForm1.Button1Click(Sender: TObject); var stream: TStringStream; idHttpObj: TIdHTTP; begin stream := TStringStream.Create('', TEncoding.UTF8); // idHttpObj := TIdHTTP.Create(nil); idHttpObj.Get(Url, stream); idHttpObj.Free; Memo1.Text := stream.DataString; stream.Free; end;
标签:UTF,stream,idHTTP,Delphi,Free,idHttpObj,Create 来源: https://blog.51cto.com/u_14617575/2744281