Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 18, 2010, 08:30 PM   #1
dutchchilly
macrumors member
 
Join Date: Jun 2009
Problem with TouchXML and UTF-8

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.

Last edited by dutchchilly; Jul 18, 2010 at 09:32 PM.
dutchchilly is offline   0 Reply With Quote
Old Jul 24, 2010, 09:43 AM   #2
patsalko
macrumors newbie
 
Join Date: Jul 2010
Quote:
Originally Posted by dutchchilly View Post
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!
patsalko is offline   0 Reply With Quote
Old Jul 25, 2010, 11:45 AM   #3
patsalko
macrumors newbie
 
Join Date: Jul 2010
never mind. Solved it.
patsalko is offline   0 Reply With Quote
Old Jul 25, 2010, 01:27 PM   #4
seepel
macrumors 6502
 
Join Date: Dec 2009
Quote:
Originally Posted by patsalko View Post
never mind. Solved it.
How did you solve it?
__________________
Free iOS App that turns your music library into an info graphic.
Phonographic
seepel is offline   0 Reply With Quote
Old Jul 26, 2010, 03:42 PM   #5
dutchchilly
Thread Starter
macrumors member
 
Join Date: Jun 2009
CXMLDocument *rssParser = [[[CXMLDocument alloc] initWithContentsOfURL:url encoding:NSISOLatin1StringEncoding options:0 error:nil] autorelease];
dutchchilly is offline   0 Reply With Quote
Old Jul 27, 2010, 05:15 AM   #6
namanhams
macrumors regular
 
Join Date: Jun 2009
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];
namanhams is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Mac awk can't process UTF-16 file mikezang OS X 1 Jul 10, 2014 06:13 PM
GoodPlayer Problem - Never mind. Problem solved. BasicGreatGuy iPad Apps 0 Mar 14, 2014 02:18 PM
iTunes DRM problem? Or, HD Versions of Movie on ATV1 Problem? Aqueous Apple TV and Home Theater 5 Feb 9, 2014 08:54 AM
MacBook Pro Problem! Booting up problem! Legolasas MacBook Pro 2 Jan 21, 2013 10:54 AM

Forum Jump

All times are GMT -5. The time now is 01:35 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC