delphi7抓取网页上的音标时成了乱码
用了两种方法,一种是
memo3.lines.Add(ihtmldocument2(webbrowser1.document).body.outerhtml)
另一种是
function GetWebPage(const Url :string; IsUtf8 :Boolean = False):string;
var
idp :TIdHTTP;
begin
Result := '';
idp := TIdHTTP.Create(Application);
try
idp.HandleRedirects := True;
idp.Request.UserAgent := 'Mozilla/5.0';
Result := idp.Get(Url);
//Result := unicodetoansi(Result);
if IsUtf8 then
Result := Utf8ToAnsi(Result);
finally
FreeAndNil(idp);
end;
end;
获取到的网页其他字符都正常,唯有音标是乱码显示,比如 brother[?br?e?(r)],
请教!