Re: NSXMLDocument encoding
Re: NSXMLDocument encoding
- Subject: Re: NSXMLDocument encoding
- From: Jens Alfke <email@hidden>
- Date: Mon, 5 May 2008 14:14:09 -0700
On 5 May '08, at 12:53 PM, Robert Cerny wrote:
doc = [[NSXMLDocument alloc] initWithData:webData
options:NSXMLDocumentTidyHTML
error:&error];
Try using -initWithContentsOfURL: instead — then it can see the HTTP
headers, which might describe the encoding.
You don't get an error back in the 'error' parameter?
However I don't get correctly encoded data from NSXMLNodes
Well, what *do* you get? Show us the data and what you expected.
When I get contents of URL as NSData and convert it to [NSString
initWithData:(NSData *)data encoding:(NSStringEncoding)encoding] and
provide NSWindowsCP1250Encoding, I get correct result.
Then you could use the -initWithXMLString: initializer instead...
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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