Re: NSXMLParser initWIthData - Encoding?
Re: NSXMLParser initWIthData - Encoding?
- Subject: Re: NSXMLParser initWIthData - Encoding?
- From: Keary Suska <email@hidden>
- Date: Fri, 21 May 2010 11:01:55 -0600
On May 21, 2010, at 10:39 AM, Patrick Rutkowski wrote:
> I find it disgusting that the doc section for NSXMLParser initWithData takes binary data, but doesn't tell you which encoding it's supposed to be?
>
> Link:
> http://developer.apple.com/mac/library/documentation/cocoa/reference/foundation/Classes/NSXMLParser_Class/Reference/Reference.html#//apple_ref/occ/instm/NSXMLParser/initWithData:
>
> I'm still pretty new to XML though, does the encoding always have to be UTF-8, or perhaps always UTF-16?
>
> Either way, which encoding does initWithData expect to get? Does it perhaps detect which encoding is being used, based on the data you give it?
I imagine that it expects the encoding to match the doctype declaration. Whether it does any conversions is just gravy--my understanding of the XML spec is that parsers aren't expected to do any encoding conversions.
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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