On 22 Sep 2016, at 16:30, Ken Thomases <k...@codeweavers.com> wrote:
> 
> Without undermining Alastair's recommendations, you can achieve what you want 
> by round-tripping the string through -[NSString fileSystemRepresentation] and 
> -[NSFileManager stringWithFileSystemRepresentation:length:].  That handles 
> the normalization, but it doesn't do anything about characters that aren't 
> legal in file names on a given file system.

:-)  I pondered mentioning -fileSystemRepresentation but decided it didn’t 
really solve the problem.  Right now, you’re right, it does normalise strings, 
but that isn’t documented and it’s probably undesirable - the HFS 
implementation can already cope with precomposed characters and by decomposing 
before passing to the BSD APIs there’s a risk that the present implementation 
will prevent a Cocoa program from opening the correct file (or any file at all) 
on some filesystems.

(It also has no way to know what filesystem’s rules it’s supposed to use, so it 
isn’t as if Apple could selectively disable normalisation to resolve this 
problem.)

Kind regards,

Alastair.

--
http://alastairs-place.net


_______________________________________________

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

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

Reply via email to