lemur
lemur copied to clipboard
Utf8 dev
In progress development of the roblox utf8 library.
-
utf8.char is fully feature-complete, unless there are special behaviors for when multiple numbers are passed in besides just concatenating them, which I doubt
-
rbxUTF8.graphemes
is almost there. I just need to figure out when theutf8.grapheme
iterator grabs 2 (or more?) matches instead of just 1. (are they called "surrogate pairs"?)- For now the
i
andj
parameters are unused, but that behavior should be easy to reproduce once the rest of the logic is there - If someone knowledgable about this could help out, that would be wonderful.
- For now the
-
rbxUTF8.codes
is a stub. One should note, although this is not currently in the current version of the script, thatrbxUTF8.codes
is more like the Luapairs
ornext
iterators, and it requires the string and previous return value in order to grab the next. For that reason, maybe it shouldn't use a coroutine.-
rbxUTF8.graphemes
, on the other hand, holds state internally and does not require that you continually pass in arguments to spit out the next set.
-
Note: I copied the temporary tests from the linked repo towards the bottom.