• 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: URI de/encoding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: URI de/encoding


  • Subject: Re: URI de/encoding
  • From: Jim Correia <email@hidden>
  • Date: Thu, 18 May 2006 10:41:24 -0400

On May 18, 2006, at 10:08 AM, gnat wrote:

As much as URI's are used in Cocoa, I imagine there has to be some method in one of the Cocoa objects that will handle encoding and decoding URI's but I haven't been able to find it yet. Can someone point me in the right direction?

<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ ObjC_classic/Classes/NSString.html#//apple_ref/occ/instm/NSString/ stringByAddingPercentEscapesUsingEncoding:>


<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ ObjC_classic/Classes/NSString.html#//apple_ref/occ/instm/NSString/ stringByReplacingPercentEscapesUsingEncoding:>

Specifically I am reading a XML file that contains file:// localhost URIs that I am trying to copy to another location with NSFileManager copyPath:toPath:handler:, but it doesn't like the URI encodings like . It seems to be fine with the actual characters though. Maybe there is a better way to copy files using URIs instead of trying to translate the paths?

The documentation for -[NSURL path] says:

<http://devworld.apple.com/documentation/Cocoa/Reference/Foundation/ ObjC_classic/Classes/NSURL.html#//apple_ref/occ/instm/NSURL/path>

"If isFileURL returnsYES, the return value is suitable for input into NSFileManager or NSPathUtilities."

It sounds like you are passing something else to the file manager.

Jim


_______________________________________________ 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
  • Follow-Ups:
    • Re: URI de/encoding
      • From: gnat <email@hidden>
References: 
 >URI de/encoding (From: gnat <email@hidden>)

  • Prev by Date: Re: Variable scope/lifetime of class methods (concerns Threads)
  • Next by Date: Re: Variable scope/lifetime of class methods (concerns Threads)
  • Previous by thread: URI de/encoding
  • Next by thread: Re: URI de/encoding
  • Index(es):
    • Date
    • Thread