gpt4 book ai didi

ios - 结合 Grapheme Joiner 在 Cocoa、iOS 中不起作用?

转载 作者:可可西里 更新时间:2023-11-01 05:42:21 27 4
gpt4 key购买 nike

这个字符串:

[NSString stringWithFormat:@"%C%C%C%C", 0x31, 0x34f, 0x32, 0x20dd]

应该显示为 12,两个字符周围都有一个圆圈。 0x34f 是组合字素连接符,0x20dd 是组合圆。

显示的是 12,只有 2 周围有圆圈。似乎忽略了连接符。有什么方法可以让组合字素连接器工作吗?

最佳答案

不推荐使用 Combining Grapheme Joiner:

来自 Unicode 标准,第 16.2 章布局控件 - 组合字素连接器

Rendering. For rendering, the combining grapheme joiner is invisible.However, some older implementations may treat a sequence of graphemeclusters linked by combining grapheme joiners as a single unit for theapplication of enclosing combining marks. For more information ongrapheme clusters, see Unicode Technical Report #29, “Unicode TextSegmentation.” For more information on enclosing combining marks, seeSection 3.11, Normalization Forms.

来自第3.6章组合

It should be noted, however, that older implementations may havesupported the application of an enclosing combining mark to an entireIndic consonant conjunct or to a sequence of grapheme clusters linkedtogether by combining grapheme joiners. Such an approach has a numberof technical problems and leads to interoperability defects, so it isstrongly recommended that implementations do not follow it.

来自http://unicode.org/faq/char_combmark.html#19

Q: Is it possible to apply a diacritic or combining enclosing mark to a sequence of more than one (non-combining) character?

答:不,除了故意设计用于两个字母序列的“双重变音符号”,例如U+035D 组合双 BREVE。 ZWJ (U+200D ZERO WITDH JOINER) 和 CGJ (U+034F COMBINING GRAPHEME JOINER) 都不会以影响任何后续组合字符范围的方式将字符“粘合”在一起。要将像“Esc”这样的字符序列变成像 U+20E3 COMBINING ENCLOSING KEYCAP 这样的东西,你必须求助于更高级别的协议(protocol)。 [KP]

关于ios - 结合 Grapheme Joiner 在 Cocoa、iOS 中不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9355125/

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