You're truncating bios with `.slice()`. `Intl.Segmenter` knows where the emoji actually end.
A 30-character bio limit that cuts off mid-emoji isn't a rendering bug — it's .length counting UTF-16 code units instead of what's on screen. Intl.Segmenter counts graphemes, words, and sentences the way a reader actually sees them, and every major browser supports it now.
本文内容来源于互联网,版权归原作者所有
查看原文