iOS CFStringTransform和Đ [英] iOS CFStringTransform and Đ
问题描述
我正在开发一个iOS应用程序,我必须在其中列出并对人名进行排序。我有一些特殊问题的问题。
I'm working on an iOS app in which I have to list and sort people names. I've some problem with special character.
我需要对Martin R回答 https://stackoverflow.com/a/15154823/2148377
I need some clarification on Martin R answer on https://stackoverflow.com/a/15154823/2148377
您可以使用CoreFoundation CFStringTransform函数从列表中进行几乎所有转换。只有đ和Đ必须单独处理:
You could use the CoreFoundation CFStringTransform function which does almost all transformations from your list. Only "đ" and "Đ" have to be handled separately:
为什么这封信?这来自哪里?我在哪里可以找到文档?
Why this particular letter? Where does this come from? Where can I find the documentation?
非常感谢。
推荐答案
我不是百分百肯定,但我认为可以从Unicode数据库中看到
http://www.unicode.org/Public/6.2.0/ucd/UnicodeData.txt 。
I am not 100% sure, but I think it can be seen from the Unicode Data Base 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
其中字段#6是分解映射到a + U + 0300(COMBINING GRAVE ACCENT),
因此
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为空,因此这些字符没有分解为基本字符和组合标记。
where field #6 is empty, so these characters do not have a decomposition into a "base character" and a "combining mark".
所以问题仍然存在:哪个标准确定đ/Đ的标准化形式是d / D?
So the question remains: Which standard determines that a "normalized form" of "đ / Đ" is "d / D"?
这篇关于iOS CFStringTransform和Đ的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!