Re:What can’t the internet handle in 2022? Apostrophes
by throwaway09223 on Tuesday October 04, 2022 @05:33PM
(#33087301)
No. Let's do a quick recap:
You said that people ought never address text by characters or bytes.
I'm pointing out that this is nonsense and I offered several examples.
You responded saying basically that those tasks are complex and someone else should do it.
In your followup response, you recommend using ICU which ... has an interface for iterating by character. Which is all I had mentioned to begin with. Sigh.
Are you asking how one would write code for the libraries you should use? In general, there already is one: ICU.[0] But if you had to write your own, as I said above, Unicode provides algorithms[1] that one might want to implement, in addition to a massive (over 1000 page) spec[2] detailing how to handle the various languages. For example, if you need to write the code to handle bidirectional text, there's UAX/TR #9[3]. Want to implement case changing? See Chapter 3.[4]
There's also the Unicode Character Database[5] that contains information on every code point. Your library/program would need to hold a copy of this whole thing.
[0]: https://icu.unicode.org/
[1]: https://unicode.org/reports/
[2]: https://www.unicode.org/versions/Unicode15.0.0/
[3]: https://unicode.org/reports/tr9/
[4]: https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf
[5]: https://www.unicode.org/reports/tr44/tr44-30.html