gpt4 book ai didi

unicode - 组合字符可以在 Unicode 中单独使用吗?

转载 作者:行者123 更新时间:2023-12-01 18:35:30 25 4
gpt4 key购买 nike

我们以COMBINING ACUTE ACCENT为例, 例如。它的browser test page确实将它单独包含在页面中,但它的 react 很奇怪:我无法用鼠标选择它,如果我尝试在 DOM 检查器中与它交互,感觉它根本不是文本的一部分(这个字符没有之前之后):

Combining character

单独使用的组合字符是否仍然是有效的 Unicode 字符串?

还是必须跟在另一个字符后面?

最佳答案

是的,单独的组合字符是一个有效的 Unicode 字符串(即使没有基本字符它的行为可能很奇怪)。 Section 2.11 of the Unicode Standard强调这一点:

In the Unicode Standard, all sequences of character codes are permitted.

此类字符串的表示在 D52 中进行了描述:

  • There may be no such base character, such as when a combining character is at the start of text or follows a control or format character [...] In such cases, the combining characters are called isolated combining characters.

  • With isolated combining characters or when a process is unable to perform graphical combination, a process may present a combining character without graphical combination; that is, it may present it as if it were a base character.

但是,如果您想单独显示一个组合字符,建议您将它附加到一个不间断的空格基础字符上:

Nonspacing combining marks used by the Unicode Standard may be exhibited in apparent isolation by applying them to U+00A0 NO-BREAK SPACE. This convention might be employed, for example, when talking about the combining mark itself as a mark, rather than using it in its normal way in text (that is, applied as an accent to a base letter or in other combinations).

关于unicode - 组合字符可以在 Unicode 中单独使用吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38126512/

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