-[NSURL path] returning nil
-[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