On Mon, Jun 1, 2009 at 6:40 PM, Sean McBride <s...@rogue-research.com> 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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to