Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Utf8 dev #211

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Utf8 dev #211

wants to merge 2 commits into from

Conversation

Validark
Copy link
Contributor

@Validark Validark commented Aug 21, 2019

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant