Graphem-Cluster

Technical/Unicode

Ein vom Nutzer wahrgenommenes Zeichen, das aus mehreren Unicode-Codepoints bestehen kann, aber als einzelne visuelle Einheit dargestellt wird.

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.

Verwandte Werkzeuge