Re: Re: URLWithString fails to fails with bad string
Re: Re: URLWithString fails to fails with bad string
- Subject: Re: Re: URLWithString fails to fails with bad string
- From: email@hidden
- Date: Wed, 25 Nov 2009 16:31:28 +0000
On Nov 25, 2009 2:06am, Kyle Sluder <email@hidden> wrote:
On Tue, Nov 24, 2009 at 10:14 PM, email@hidden> wrote:
> This returns a non-nil value:
> NSURL * url = [NSURL URLWithString:@"sdsds"];
>
> The docs say this should fail. RFC 1758 looks for the string to begin
with a
> scheme, eg http:
While "sdsds" is indeed a valid relative URL according to RFC 2396,
don't let NSURL's declaration of RFC-conformance fool you. I have a
pretty severe bug (rdar://problem/7096953) logged against NSURL's
incorrect handling of IDNs. Despite pointing to the spec, copying it
into the bug report, and walking step by step through NSURL's
violation thereof, I was told that it behaves according to the spec
and as designed. I no longer trust NSURL's assertions of conformance.
--Kyle Sluder
So is there a way to validate a string before passing it to URLWithString?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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