[X]

One Family, Eleven Code Units

luljs 2015 still works

The family emoji is one glyph but its .length is eleven and it spreads to seven code points.

In 2026: Modern browsers on a supporting OS draw the whole sequence as one family glyph, older systems show four separate people. JavaScript length counts UTF-16 code units, so it reports 11. Spreading iterates by code point and reports 7. Neither equals the single grapheme a reader sees, which is what Intl.Segmenter counts.

Where it came from: Unicode Technical Standard #51, Emoji (2015), which defines ZWJ sequences. The family is U+1F468 U+200D U+1F469 U+200D U+1F467 U+200D U+1F466. MDN

<script>
var P = String.fromCodePoint, ZWJ = String.fromCodePoint(0x200D);
var fam = P(0x1F468) + ZWJ + P(0x1F469) + ZWJ + P(0x1F467) + ZWJ + P(0x1F466);
document.write('<p>This renders as one glyph: <b style="font-size:1.7em">' + fam + '</b></p>');
document.write('<p><code>str.length</code> (UTF-16 code units) is <b>' + fam.length + '</b></p>');
document.write('<p><code>[...str].length</code> (code points) is <b>' + [...fam].length + '</b></p>');
document.write('<p>Four person emoji joined by three zero width joiners: eleven code units, one family.</p>');
</script>
sandboxed demo · breaks nothing but itselfrestart

More in luljs

all 63 in luljs › · the whole library ›