• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Dealing with encoding in XML parsing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dealing with encoding in XML parsing


  • Subject: Re: Dealing with encoding in XML parsing
  • From: Nathan Kinsinger <email@hidden>
  • Date: Wed, 17 Sep 2008 04:11:03 -0600

On Sep 16, 2008, at 4:01 PM, Laurent Cerveau wrote:

Hi

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?

Many thanks

laurent

Keep in mind that parser:foundCharacters: may be called several times for a single string. You need to keep adding together the strings sent to parser:foundCharacters: until the parser:didEndElement:namespaceURI:qualifiedName: method is called.



--Nathan



_______________________________________________

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


References: 
 >Dealing with encoding in XML parsing (From: Laurent Cerveau <email@hidden>)

  • Prev by Date: Re: AudioQueueServices Tutorial?
  • Next by Date: Re: How do I check if at least one TWAIN device is available
  • Previous by thread: Re: Dealing with encoding in XML parsing
  • Next by thread: Inverse or remove alpha mask from tiff
  • Index(es):
    • Date
    • Thread