Re: Dealing with encoding in XML parsing
Re: Dealing with encoding in XML parsing
- Subject: Re: Dealing with encoding in XML parsing
- From: James Walker <email@hidden>
- Date: Tue, 16 Sep 2008 17:11:54 -0700
Laurent Cerveau wrote:
I have an XML document with obviously some problems with it but that
needs to be parsed in all cases.
One of the problem is apparently an encoding one as some text read in an
editor as "Restaurant, Bar, Bistro, CafĂ" (reopening with an ISO-8859-1
Windows apparently is solving the issue). The XML file itself specifies
no encoding.
The problem that I have is that such string will be reported as
"Restaurant, Bar, Bistro, Caf" by the parser in its "foundCharacters"
delegate method (and if the strange letter is in the middle of a word ,
this last one is cut).
Is there a way to "force an encoding" for an NSXMLParser? If not is
there an appropriate way to track that such confusion is happening?
Why don't you declare the correct encoding at the beginning of the XML?
Something like: <?xml encoding='ISO-8859-1'?>
--
James W. Walker, Innoventive Software LLC
<http://www.frameforge3d.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