Re: Correct way to specify anchors with NSURL?
Re: Correct way to specify anchors with NSURL?
- Subject: Re: Correct way to specify anchors with NSURL?
- From: Quincey Morris <email@hidden>
- Date: Thu, 21 Apr 2016 00:18:48 -0700
- Feedback-id: 167118m:167118agrif8a:167118s5N7Wtmkm8:SMTPCORP
On Apr 21, 2016, at 00:09 , Graham Cox <email@hidden> wrote:
>
> It strikes me that it’s a bug that URLByAppendingPathComponent: doesn’t parse for a fragment just as -initWithString: does though, the anchor/fragment is a perfectly reasonable part of a path and what other possible ambiguious meaning could it have? It makes hard work of something that should be easy.
The point is that an unescaped “#” or “?” is a delimiter of the *end* of the path portion of the URL. If a *path* component — URLByAppendingPathComponent — contains one of these characters, it’s by definition part of the path and not a delimiter, and so must be escaped.
The issue is that nobody (e.g. you) cares about that. For practical purposes, it’s just a string and you should be able to append stuff to it.
_______________________________________________
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