Re: Relative URLs, and string encodings
Re: Relative URLs, and string encodings
- Subject: Re: Relative URLs, and string encodings
- From: Jonathan Taylor <email@hidden>
- Date: Fri, 2 Jun 2017 09:44:02 +0100
>> My attempt like:
>> [NSURL URLWithString:[path stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding] relativeToURL:relativeTo];
>
> Ah, you want NSUTF8StringEncoding instead. Generally speaking, URL encoding always uses UTF-8 nowadays.
Thankyou for your reply Jens. That's reassuring. (And soon after sending that I discovered that my proposed use of NSUnicodeStringEncoding was badly broken because it prevented url.path.UTF8String from working. Surprise, surprise: using your recommended UTF8 makes that work!
> You mean an open or close (aka “curly”) quote? They’re easily typed with Option-[ and Option-Shift-[.
Ah yes, I knew that once, back in the day before text editors started auto-creating the open/close quotes themselves. I only write them manually in LaTeX these days.
Cheers
Jonny
_______________________________________________
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