OS X - how to calculate normalized file name

前端 未结 3 1099
孤街浪徒
孤街浪徒 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:57

    I think the answer is this from TechNote 1150 HFS Plus Volume Format:

    Note: The Mac OS Text Encoding Converter provides several constants that let you convert to and from the canonical, decomposed form stored on HFS Plus volumes. When using CreateTextEncoding to create a text encoding, you should set the TextEncodingBase to kTextEncodingUnicodeV2_0, set the TextEncodingVariant to kUnicodeCanonicalDecompVariant, and set the TextEncodingFormat to kUnicode16BitFormat. Using these values ensures that the Unicode will be in the same form as on an HFS Plus volume, even as the Unicode standard evolves.

提交回复
热议问题