Filenames

The only two invalid characters for OS X filesystems (UFS, HFS+, and HFSX) are slash ('/') and null ('\0')

Text encoding of filenames

OS X supports international unicode characters in filenames, the filename must be normalized to Apple's "nearly" Unicode NFD (NFD with Apple HFS+ variations).

OS X always uses NFD on its hfs+ filesystem (or even when using FAT on a memory stick).
(The above assumes you are using the POSIX API, not the legacy pre-OS X API.)

Windows XP and Linux do not perform any normalization, they just store the filename as given.

Cross-platform compatibility

The following characters are valid in OS X but should be avoided in filenames if you need compatibility with other operating systems:

: (colon)
\ (back-slash)
¢™$® (Unicode symbols)
. , [ ] { } ( ) ! ; " ' * ? < > | (Punctuation marks)
White space characters such as spaces, tabs, new lines and embedded returns.

Related:

Cross-platform filename best practices and conventions - Apple Support
jroller.com - unicode file names
unicode.org - Normalization Form D (NFD)
OS X Syntax


© Copyright SS64.com 1999-2014
Some rights reserved