Fable
Fable copied to clipboard
Add supports for `System.Text.Rune` API
Description
For a library I am working on, I will need the System.Text.Rune
API.
At the moment here is the API I am using:
rune.*
are instance methods / properties
-
Rune.GetRuneAt
-
rune.ToString()
-
rune.Utf16SequenceLength
-
rune.Value
-
c.EnumerateRunes()
=> I could probably useRune.GetRuneAt
with a while loop to mimic this API
I think the most difficult part will be to get the rune.Value
because we need to find how to convert a character/string char into this value.
Once this is done, adding the different properties / static member should not be too difficult. For JavaScript, this file can be a source of inspiration on how to deal with unicode characters especially how to detect the ones using 2 bytes in UTF 16.
// Detect 2 bytes characters
(string.charCodeAt(offset) & 0xF800) === 0xD800
I am creating this issue just to keep track of this future work.