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

标签 unicode

我们以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/

相关文章:

python - 在 Python 2.7 中打印 UTF-8 字符

unicode - 在 Sublime Text 2 中搜索转义字符

c# - 从大文本文件中读取 unicode 字符

Python:getsize 无法从 itunes xml 中找到文件位置

linux - 如何在 Linux 中用韩文字符对文件进行排序?

python-2.7 - Scrapy 从 unicode 转换为 utf-8

Python 统一码 : how to test against unicode string

python - 为什么字符串对象的 IronPython str() 会引发 UnicodeEncodeError?

android - 如何在 Android 上的 HttpPost 中发送 unicode 字符

html - Firefox 中从右到左语言的分隔字符