gpt4 book ai didi

objective-c - iOS CFStringTransform 和 Đ

转载 作者:行者123 更新时间:2023-12-02 08:40:43 24 4
gpt4 key购买 nike

我正在开发一个 iOS 应用程序,我必须在其中列出人名并对其进行排序。我有一些特殊字符的问题。

我需要澄清 Martin R 在 https://stackoverflow.com/a/15154823/2148377 上的回答

You could use the CoreFoundation CFStringTransform function which does almost all transformations from your list. Only "đ" and "Đ" have to be handled separately:

为什么写这封信?这是从哪里来的?我在哪里可以找到文档?

非常感谢。

最佳答案

我不是 100% 确定,但我认为可以从 Unicode 数据库中看出 http://www.unicode.org/Public/6.2.0/ucd/UnicodeData.txt .

例如,“à”的条目是

00E0;LATIN SMALL LETTER A WITH GRAVE;Ll;0;L;0061 0300;;;;N;LATIN SMALL LETTER A GRAVE;;00C0;;00C0

where field #6 is the "Decomposition mapping" into "a" + U+0300 (COMBINING GRAVE ACCENT),therefore

CFStringTransform(..., kCFStringTransformStripCombiningMarks, ...)

将“à”转换为“a”。

“Đ”和“đ”的条目是

0110;LATIN CAPITAL LETTER D WITH STROKE;Lu;0;L;;;;;N;LATIN CAPITAL LETTER D BAR;;;0111;0111;LATIN SMALL LETTER D WITH STROKE;Ll;0;L;;;;;N;LATIN SMALL LETTER D BAR;;0110;;0110

#6 字段为空,因此这些字符没有分解为“基本字符”和“组合标记”。

那么问题来了:哪个标准决定了“đ/Đ”的“归一化形式”是“d/D”?

关于objective-c - iOS CFStringTransform 和 Đ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16836975/

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