Comment

Comment by re

Further reading:

* https://hoytech.github.io/truncate-presentation/ / https://metacpan.org/pod/Unicode::Truncate

* https://unicode.org/reports/tr29/#Grapheme_Cluster_Boundarie...

Truncating at codepoint boundaries at least avoids generating invalid (non-UTF-8) strings, but can still result in confusing or incorrect displays for human readers, so for best results the truncation algorithm should take extended grapheme clusters into account, which are probably the closest thing that Unicode has to what most people think of as "characters".

parent re 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton