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

Text encoding of filenames

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

macOS 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-macOS 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 macOS 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.


Cross-platform filename best practices and conventions - Apple Support - unicode file names - Normalization Form D (NFD)
macOS Syntax

Copyright © 1999-2017
Some rights reserved