Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 18, 2010, 07: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 08:32 PM.
dutchchilly is offline   0 Reply With Quote
Old Jul 24, 2010, 08: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, 10: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, 12: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, 02: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, 04: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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Problems with Rsync and iPhoto library tommekevda OS X 2 May 19, 2011 10:50 AM
problems with sharepoints and and external drive Vending Mac Basics and Help 0 Oct 18, 2007 11:03 PM
Odd problem with wifi and Edge - nevermind I see everyones having problems with EDGE pkts iPhone Tips, Help and Troubleshooting 8 Jul 2, 2007 05:12 PM
Problem with quicktime and audio with mpeg video Arip Mac Applications and Mac App Store 0 Mar 14, 2007 03:11 PM
A little problem with IE and 10.3.9 and a couple of questions tonicardo Mac Applications and Mac App Store 6 Nov 1, 2005 06:52 PM


All times are GMT -5. The time now is 01:56 AM.

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

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