组合 Grapheme Joiner 在 Cocoa、iOS 中不起作用?

发布于 2025-01-06 18:46:32 字数 247 浏览 0 评论 0原文

该字符串:

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

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

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

This string:

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

ought to display as 12 with a circle around both characters. 0x34f is the Combining Grapheme Joiner, and 0x20dd is a combining circle.

What gets displayed is 12 with the circle around only the 2. The joiner seems to be ignored. Is there any way to get the combining grapheme joiner to work?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

迷荒 2025-01-13 18:46:32

不建议使用 Combining Grapheme Joiner:

来自 Unicode 标准,第 16.2 章布局控件 - Combining Grapheme Joiner

渲染。对于渲染,组合字素连接器是不可见的。
然而,一些较旧的实现可能会处理一系列字素
通过将字素连接器组合为单个单元来链接簇
封闭组合标记的应用。欲了解更多信息
字素簇,请参阅 Unicode 技术报告 #29,“Unicode 文本
分割。”有关封闭组合标记的更多信息,请参阅
第 3.11 节,规范化形式。

来自第 3.6 章组合

但是,应该注意的是,旧的实现可能有
支持将封闭组合标记应用于整个
印度语辅音连词或一系列相连的字素簇
通过将字素连接器组合在一起。这种方法有很多
技术问题并导致互操作性缺陷,因此
强烈建议实现不要遵循它。

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

<块引用>

问:是否可以对包含多个(非组合)字符的序列应用变音符号或组合封闭标记?

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

This use of Combining Grapheme Joiner is not recommended:

From the Unicode standard, Chapter 16.2 Layout Controls - Combining Grapheme Joiner

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

From Chapter 3.6 Combination

It should be noted, however, that older implementations may have
supported the application of an enclosing combining mark to an entire
Indic consonant conjunct or to a sequence of grapheme clusters linked
together by combining grapheme joiners. Such an approach has a number
of technical problems and leads to interoperability defects, so it is
strongly recommended that implementations do not follow it.

And from 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?

A: No, with the exception of the “double diacritics” deliberately designed to be applied onto a two letter sequence, e.g. U+035D COMBINING DOUBLE BREVE. Neither ZWJ (U+200D ZERO WITDH JOINER) nor CGJ (U+034F COMBINING GRAPHEME JOINER) “glue” characters together in a way that the scope of any following combining character would be affected. To get a character sequence like “Esc” into something like the U+20E3 COMBINING ENCLOSING KEYCAP, you must resort to higher-level protocols. [KP]

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文