Re: NSXMLDocument encoding
Re: NSXMLDocument encoding
- Subject: Re: NSXMLDocument encoding
- From: Ricky Sharp <email@hidden>
- Date: Mon, 5 May 2008 15:41:38 -0500
On May 5, 2008, at 2:53 PM, Robert Cerny wrote:
I use NSXMLDocument to parse web page content, which is in
NSWindowsCP1250Encoding. However I don't get correctly encoded data
from NSXMLNodes
NSURLRequest *req = [NSURLRequest requestWithURL:[NSURL
URLWithString:url]];
NSData *webData = [NSURLConnection sendSynchronousRequest:req
returningResponse:&response
error:&error];
doc = [[NSXMLDocument alloc] initWithData:webData
options:NSXMLDocumentTidyHTML
error:&error];
[doc setCharacterEncoding:@"windows-1250"];
does anyone have an idea what's wrong?
You're going to have to provide more detail. For example, given a
starting string, how is it getting mangled?
The best thing to do for encoding issues is to divide and conquer to
see where there problem(s) is/are.
For example, how exactly is the data from the web-site handled? e.g.
does the URL point directly to an XML file? Is there something about
the HTTP header that is specifying the wrong encoding?
Is there an encoding attribute in the XML file itself?
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden