vignesh kumar
vignesh kumar

Reputation: 2330

ASIHTTPRequest always use defaultresponseEncoding insted of Encoding mentioned in the XML file

Problem is that, while downloading an XML file using ASIHTTPRequest it use default response encoding instead of using the encoding in "encoding" attribute in the header.

The class use header information to set the responseEncoding to the particular encoding in "Charset". So the class works well in case of a HTML page as it include the encoding type in the header itself.

The default encoding is NSISOLatin1StringEncoding but the encoding in the attribute is UTF-8, which render response string like "función" instead of "función".

So I want responseEncoding property of request(ASIHTTPRequest) to be set to the encoding type in the XML file

Upvotes: 0

Views: 915

Answers (2)

vivek
vivek

Reputation: 21

If it is your NSLog statement output then it is correct and the ASIHTTPRequest class is working correct only

Upvotes: 2

JosephH
JosephH

Reputation: 37505

ASIHTTPRequest does not parse your xml file, it decides the encoding based solely on the contents of the http headers.

Use request.responseData to get the raw data instead and do the conversion to string yourself.

Upvotes: 1

Related Questions