Indy TIdHTTPResponseInfo charset support
Does anyone know how to set charset for Indy TIdHTTPResponseInfo?
In html:
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=koi8-r"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
I have tried to set charset as following: var aResponseInfo : TIdHTTPResponseInfo; aResponseInfo.ContentType :='charset=utf-8'; or aResponseInfo.AcceptCharSet:='utf-8'; or aResponseInfo.ContentEncoding:='utf-8'; And then I send a Response in non-english characters (ASCII $81H-$FFH), such as KOI8-R, BIG5, UTF-8
aResponseInfo.ResponseText :='.... ÍøÍ ....'; or aResponseInfo.ResponseText := '..... ' + GBToUTF(' <b>Öйú</b>') + '....'; As long as I send any ASCII between $80H - $FFH, Browser hangs.
Maybe I have to use other class, such as TidCustomHTTPServer.
Any suggestions?
Hi,
I think that you could post this support request to Indy newsgroups, Indy web forums, or Indy-Dev-Public. See : http://www.indyproject.org/Support.EN.aspx
Best regards, Pierre.
Log in to post a comment.
Indy TIdHTTPResponseInfo charset support
Does anyone know how to set charset for Indy TIdHTTPResponseInfo?
In html:
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=koi8-r">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
I have tried to set charset as following:
var aResponseInfo : TIdHTTPResponseInfo;
aResponseInfo.ContentType :='charset=utf-8';
or
aResponseInfo.AcceptCharSet:='utf-8';
or
aResponseInfo.ContentEncoding:='utf-8';
And then I send a Response in non-english characters (ASCII $81H-$FFH), such as KOI8-R, BIG5, UTF-8
aResponseInfo.ResponseText :='.... ÍøÍ ....';
or
aResponseInfo.ResponseText := '..... ' + GBToUTF(' <b>Öйú</b>') + '....';
As long as I send any ASCII between $80H - $FFH, Browser hangs.
Maybe I have to use other class, such as TidCustomHTTPServer.
Any suggestions?
Hi,
I think that you could post this support request to Indy newsgroups, Indy web forums, or Indy-Dev-Public.
See :
http://www.indyproject.org/Support.EN.aspx
Best regards,
Pierre.