Is there a way to extract the first letter of a UTF-8 encoded string using Lua?
Lua string.sub("ÆØÅ", 2, 2) not support Unicode correctly, so string.sub("ÆØÅ", 2, 2) will return "?" , not "Ø" .
Is there a relatively simple UTF-8 parsing algorithm that I could use for a string byte for each byte, for the sole purpose of getting the first letter of the string, be it a Chinese character or A?
Or is this way too complicated, requiring a huge library, etc.?
forthrin
source share