• 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
stringWithContentsOfURL:encoding:error weirdness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

stringWithContentsOfURL:encoding:error weirdness


  • Subject: stringWithContentsOfURL:encoding:error weirdness
  • From: "Doug Knowles" <email@hidden>
  • Date: Sun, 8 Apr 2007 15:22:03 -0400

I have been using, quite successfully, NSString's
stringWithContentsOfURL:encoding:error to read RSS feeds from various
sources.  All of sudden, I'm getting errors when trying to process
CNN's feeds (which I used to read successfully): the method returns a
null result and an encoding error:

Error: NSError "File could not be opened using text encoding Unicode
(UTF-8)." Domain=NSCocoaErrorDomain Code=261
UserInfo={NSStringEncoding = 4; NSURL =
http://rss.cnn.com/rss/money_latest.rss; }

I can download the feed using curl from the command line, and it looks
OK; the HTTP header says the content is UTF-8, the XML header says its
UTF-8, and BBEdit doesn't have any trouble opening the curl-downloaded
content.

I've tried specifying other encodings, and at best I get garbage that
can't be parsed as XML.

Any ideas?  My next idea is to open and process the URL connection
myself, but I'd rather keep the simple implementation and fry other
fish first.

TIA,
Doug Knowles
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: stringWithContentsOfURL:encoding:error weirdness
      • From: "Doug Knowles" <email@hidden>
  • Prev by Date: dumb bindings/user defaults question
  • Next by Date: Re: Multiple developers and nib files
  • Previous by thread: Re: dumb bindings/user defaults question
  • Next by thread: Re: stringWithContentsOfURL:encoding:error weirdness
  • Index(es):
    • Date
    • Thread