字素簇

Technical/Unicode

用户感知到的单个字符单位,可能由多个Unicode码位组合而成,但显示为单一视觉元素。

A grapheme cluster is what a user sees as "one character" on screen, even though it may be encoded as several code points. This concept is crucial for emoji because many emoji are composed of multiple code points.

For example, a flag emoji like 🇰🇷 is two Regional Indicator code points. A person emoji with skin tone like 👍🏽 is two code points (the gesture + a modifier). ZWJ sequences can combine even more.

Programming languages differ in how they handle grapheme clusters. JavaScript's `.length` counts UTF-16 code units, so `'👨‍👩‍👧'.length` returns 8, not 1. Proper grapheme-aware APIs (like `Intl.Segmenter`) return the expected count of 1.

相关术语

ICU (ICU) ICU (ICU)
国际Unicode组件(International Components for Unicode),广泛使用的开源库,提供Unicode和国际化支持,包括表情符号处理。
码位 码位
Unicode标准中分配给每个字符的唯一数值,以U+XXXX格式表示(例如😀对应U+1F600)。
零宽连接符(ZWJ) (ZWJ) 零宽连接符(ZWJ) (ZWJ)
一个不可见的Unicode字符(U+200D),用于将多个表情符号合并为单一复合表情符号,例如将人物与物体组合成职业表情符号。

相关工具

🔍 序列分析器 序列分析器
将 ZWJ 序列、肤色修饰符、键帽序列和旗帜对解析为独立组成部分。
🔢 Unicode 查询 Unicode 查询
输入 U+1F600 等码位,获取表情符号、编码详情、UTF-8/16 字节和 HTML 实体。