• 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
Re: Relative URLs, and string encodings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Relative URLs, and string encodings (From: Jonathan Taylor <email@hidden>)
 >Re: Relative URLs, and string encodings (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Relative URLs, and string encodings
  • Next by Date: Re: KVO - deallocation with observers attached
  • Previous by thread: Re: Relative URLs, and string encodings
  • Next by thread: Re: KVO - deallocation with observers attached
  • Index(es):
    • Date
    • Thread