OS X - how to calculate normalized file name

前端 未结 3 1104
孤街浪徒
孤街浪徒 2021-01-13 02:28

I need to create a mapping between file names generated on Windows and OS X. I know that OS X \"converts all file names to decomposed Unicode\" however, \"most volume forma

3条回答
  •  情歌与酒
    2021-01-13 02:52

    You're probably looking for -[NSString fileSystemRepresentation] method.

    Note that there is no general solution for this task. What is a valid file name depends on filesystem of the volume you're saving on. Not every file name valid for HFS+ is valid for FAT32, for example.

    For Mac's “standard” filesystem (currently HFS+), fileSystemRepresentation should give what you need; for other file systems, there is no general way. Think about ones that don't exist but will be introduced in the future, for example :)

提交回复
热议问题