Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dutchchilly

macrumors member
Original poster
Jun 29, 2009
38
0
Hi,

I'm trying to get RSS data from a 3rd party website.
The header of the feed is:

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- generator="FeedCreator 1.7.2" -->
<rss version="2.0">

The code was running fine until an article was added with the 'é' character in it.
My log shows the message "Input is not proper UTF-8, indicate encoding".

Is there a workaround for it, as I cannot change the header of the RSS feed?

Thanks in advance

Edit: Found it, I've should have used 'NSISOLatin1StringEncoding' for the encoding option. It works now.
 
Hi,

I'm trying to get RSS data from a 3rd party website.
The header of the feed is:

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- generator="FeedCreator 1.7.2" -->
<rss version="2.0">

The code was running fine until an article was added with the 'é' character in it.
My log shows the message "Input is not proper UTF-8, indicate encoding".

Is there a workaround for it, as I cannot change the header of the RSS feed?

Thanks in advance

Edit: Found it, I've should have used 'NSISOLatin1StringEncoding' for the encoding option. It works now.
Hello.
I am having the same issue.
How exactly and where did you set NSISOLatin1StringEncoding option???

Thanks!
 
CXMLDocument *rssParser = [[[CXMLDocument alloc] initWithContentsOfURL:url encoding:NSISOLatin1StringEncoding options:0 error:nil] autorelease];
 
I also had the same problem and here's how i solve it : first convert data to string, then using the string to build the CXMLDocument.

Code:
// assume 'data' is what you get from the web service
NSString *s = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease];
	
CXMLDocument *document = [[[CXMLDocument alloc] initWithXMLString:s options:0 error:error] autorelease];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.