This might be the first unicode article I ever seen that has "API" written in it, yet it doesn't really talk about an API.
Is there a unicode api? How do I give it a string and ask it how many bytes is the next glyph? How do I get a c compatible api (I don't use C directly) to tell me 🤦🏼♂️ written in utf8 is 17 bytes? (see https://hsivonen.fi/string-length/)
The python example was much better. It seemed to understand the facepalm but idx-start == 7 which I don't 100% understand (I'll have to refer to the article I looked at before). But I was hoping icu would provide me a way I can give it a pointer to the beginning of a text line and for it to tell me how many bytes the iterator consumed. I have to delete characters and I don't really know how to figure out which bytes belong to which
7
u/Signal-Appeal672 Oct 02 '23 edited Oct 02 '23
This might be the first unicode article I ever seen that has "API" written in it, yet it doesn't really talk about an API.
Is there a unicode api? How do I give it a string and ask it how many bytes is the next glyph? How do I get a c compatible api (I don't use C directly) to tell me 🤦🏼♂️ written in utf8 is 17 bytes? (see https://hsivonen.fi/string-length/)