I'm working on Delphi XE5 and Getting XML from server by using IDHTTP. Getting XML works fine but there are some broken character. The character is '•' (Bullet point). others are fine but the bullet point is broken.
I created IDHTTP like below:
idhttps := TIdHTTP.Create();
idhttps.IOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
idhttps.IOHandler.DefStringEncoding := IndyTextEncoding(TEncoding.UTF8);
idhttps.HandleRedirects := True;
idhttps.ConnectTimeout := 5000;
idhttps.Request.USERNAME := 'USERNAME';
idhttps.Request.PASSWORD := 'PASSWORD';
idhttps.Request.BasicAuthentication := True;
idhttps.Request.Accept := 'text/xml';
And then getting xml like below:
SS := TStringStream.Create('', TEncoding.UTF8);
try
self.GetIdHTTPForLexicomp.Get(URL, SS);
XMLDoc := TXMLDocument.Create(nil);
XMLDoc.LoadFromStream(SS, TXMLEncodingType.xetUTF_8Like);
finally
SS.Free;
end;
In XML bullet point is displayed like below:
? Anaphylaxis/hypersensitivity: May cause hypersensitivity reactions,
XML header is below:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
What should i check?
Thanks.
No comments:
Post a Comment