lemur icon indicating copy to clipboard operation
lemur copied to clipboard

Utf8 dev

Open Validark opened this issue 5 years ago • 0 comments

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 the utf8.grapheme iterator grabs 2 (or more?) matches instead of just 1. (are they called "surrogate pairs"?)

    • For now the i and j 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.
  • rbxUTF8.codes is a stub. One should note, although this is not currently in the current version of the script, that rbxUTF8.codes is more like the Lua pairs or next 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.

Validark avatar Aug 21 '19 05:08 Validark