• 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
-[NSURL path] returning nil
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

-[NSURL path] returning nil


  • Subject: -[NSURL path] returning nil
  • From: Tomas Franzén <email@hidden>
  • Date: Fri, 25 Aug 2006 22:27:35 +0200

Hi,

When I query an NSURL for its path, it returns nil. The reason seems to be that the URL contains "ä" (the character 'ä'). The docs say that -[NSURL path] returns nil if the URL doesn't conform to RFC 1808, but as far as I can tell, this URL should be valid:

http://example.com/värld/

RFC 1808 refers to RFC 1738, which pretty much says that any unsafe character may be used as a character triplet.


Here's some sample code to prove my point. The NSURL instance itself is created just fine, and the whole URL is displayed properly when NSLogging it. However, when I query the path, I get nil. Changing the encoded character triplet to " " (a space character) makes it return the correct path.


NSURL *URL = [NSURL URLWithString:@"http://example.com/värld/";];
NSLog(@"Path: %@",[URL path]);


Any help is appreciated. Thanks.

Tomas Franzén
Lighthead Software
http://www.lightheadsw.com/


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: -[NSURL path] returning nil
      • From: Nir Soffer <email@hidden>
  • Prev by Date: Detecting non-responsive app
  • Next by Date: Re: NSData dataWithContentsOfMappedFile with huge files?
  • Previous by thread: Re: Detecting non-responsive app
  • Next by thread: Re: -[NSURL path] returning nil
  • Index(es):
    • Date
    • Thread