Re: URI de/encoding
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