Re: How determine if file is in Trash, given Path or Alias
Re: How determine if file is in Trash, given Path or Alias
- Subject: Re: How determine if file is in Trash, given Path or Alias
- From: Michael Ash <email@hidden>
- Date: Tue, 2 Jun 2009 00:38:40 -0400
On Mon, Jun 1, 2009 at 6:40 PM, Sean McBride <email@hidden> wrote:
> But it's not a huge issue: fileSystemRepresentation and UTF8String give
> the same thing 99% of the time.
And more importantly, the 1% of the time where they give you different
results, they still give you *equivalent* results.
-fileSystemRepresentation does some canonicalization before converting
to UTF-8, but anything that wants UTF-8 will take the canonical form
and vice versa. (There used to be some bugs on OS X with
non-normalized unicode in the filesystem, but they were fixed a LONG
time ago, so unless you're still writing code for 10.2 or something,
you don't need to worry about this.)
The only reasons to use -fileSystemRepresentation these days are
either to make the code more explicit about its intentions, or to
attempt to proof the code against a change in the file system encoding
to something other than UTF-8. Given the pervasiveness of UTF-8 in Mac
OS X will almost certainly never change until Apple builds something
new from scratch, and quite probably not even then. It may be useful
if you anticipate targeting a non-Apple Cocoa platform such as GNUStep
or Cocotron.
Mike
_______________________________________________
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