0

I'm hard at work getting my XML into my application from the following link:http://jeffstockdale.com/API/output.xml . It is now working perfectly for the regular XML elements, however I'm having a problem with CData. It arrives at and handles the information in the first PostContent element CData, but in stead of moving on to the next post element to get it's data (and the data for the rest of the document), it just stops before the /PostContent and returns the following error:

2014-10-09 20:35:05.479 AppName[10393:402603] NSXMLParser encountered an error: Error Domain=NSXMLParserErrorDomain Code=9 "The operation couldn’t be completed. (NSXMLParserErrorDomain error 9.)" UserInfo=0x17027bb80 {NSXMLParserErrorColumn=25, NSXMLParserErrorLineNumber=29, NSXMLParserErrorMessage=Input is not proper UTF-8, indicate encoding ! Bytes: 0x85 0x0D 0x0A 0x0D }

Here is the code I have at this moment:

-(void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock {
    NSString *someString = [[NSString alloc] initWithData:CDATABlock encoding:NSUTF8StringEncoding];
    NSLog(@"The data was: %@", someString);
}

I appreciate any assistance you could offer regarding this!

Kirkland
  • 798
  • 1
  • 8
  • 20

1 Answers1

0

So it turns out a problem I was having earlier was actually this one. Answers by some very helpful StackOverflow members can be found here:

PHP Outputs XML in ASCII when I need UTF-8

Community
  • 1
  • 1
Kirkland
  • 798
  • 1
  • 8
  • 20