gpt4 book ai didi

macos - OS X - 如何计算标准化文件名

转载 作者:行者123 更新时间:2023-12-04 18:46:41 26 4
gpt4 key购买 nike

我需要在 Windows 和 OS X 上生成的文件名之间创建映射。我知道 OS X "converts all file names to decomposed Unicode"然而,"most volume formats do not follow the exact specification for these normal forms"

因此,使用标准 UTF8 API 将 Windows 名称转换为 NFD 并确保我拥有正确的 OS X 名称似乎不是一件简单的事情。有没有办法确定实际的 OS X 文件名,而无需在文件系统中实际创建文件,然后扫描目录以查看实际创建的内容?

最佳答案

我认为answer这是来自 TechNote 1150 HFS Plus 卷格式:

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.

关于macos - OS X - 如何计算标准化文件名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13089582/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com