Re:UTF-8 Everywhere
by smasher164 on Tuesday April 14, 2020 @05:54PM
(#22871974)
It's not though. Replacing invalid byte sequences is not terribly difficult.
https://golang.org/src/strings/strings.go?s=15854:15900#L627.
The latter is fiendishly difficult to get right in all cases, the ugliest case being emoji flags. Being all-or-nothing on both sides of a ZWJ will get you most of the way there, however.