今日已更新 84 条资讯 | 累计 37333 条内容
关于我们

You're truncating bios with `.slice()`. `Intl.Segmenter` knows where the emoji actually end.

Parsa Jiravand 2026年08月27日 17:30 0 次阅读 来源:Dev.to

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.

本文内容来源于互联网,版权归原作者所有
查看原文