关键部分代码:
FIdhttp.Request.Referer := SQL;
stream := TStringStream.Create('');
stream.Position := 0;
FIdhttp.Get(SQL, stream);
if Pos('utf-8',FIdhttp.Request.ContentType)>0 then //根据返回类型获取编码
s := Utf8ToAnsi(stream.DataString)
else
if UTF8Decode(stream.DataString)<>'' then
s := UTF8Decode(stream.DataString)
else
s := stream.DataString;
bl_result := Analystr(s);
stream.Free;