Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add supports for System.Text.Rune API #3860

Open
MangelMaxime opened this issue Jun 25, 2024 · 0 comments
Open

Add supports for System.Text.Rune API #3860

MangelMaxime opened this issue Jun 25, 2024 · 0 comments

Comments

@MangelMaxime
Copy link
Member

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 use Rune.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.

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

No branches or pull requests

1 participant