4 ms·
I wondered about how to do simple text centering / spacing justification given graphemes showing string lengths that don't match up human-perceived characters,
by zzzeek 3y ago
I wondered about how to do simple text centering / spacing justification given graphemes showing string lengths that don't match up human-perceived characters, like in 'Café' (python len('Café') returns 5, even though we see four letters).
Found this! good to know about. https://pypi.org/project/grapheme/ https://pypi.org/project/grapheme/ "A Python package for working with user perceived characters. "
(apparently the article talks about this however the blog post is largely unreadable due to dozens of animated arrow pointers jumping all over the screen)