Search code examples
iosunicodefilenames

Unicode filenames in iOS


Is it possible to use the full range of (let's say) the Chinese language in filenames of assets (images) within iOS? If not, what portions of big languages are supported in filenames, string searches and other file handling activities?


Solution

  • The iOS filesystem uses case-sensitive HFSX, which is a variant of HFS Plus and uses the same rules for filenames and character encodings.

    Those rules are laid out in several sections of Apple Technote 1150.

    The important considerations are:

    • You may use up to 255 16-bit Unicode characters per file or folder name as described in the HFS Plus Names section of Technote 1150.
    • The filesystem at its base level uses Unicode v2.0 (this is fixed) and strings must be stored in fully decomposed, canonical order. This precludes the use of some "equivalent forms" -- i.e. they must be converted to decomposed form. This is described in detail in the Unicode Subtleties section of Technote 1150. This section details other issues and should be read carefully.
    • A list of illegal characters can be found in this Decomposition Table.
    • The colon character ':' is used as a directory separator and is invalid in file and folder names.