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

Make functions to read and write code points public #307

Closed
fzhinkin opened this issue May 2, 2024 · 0 comments · Fixed by #308
Closed

Make functions to read and write code points public #307

fzhinkin opened this issue May 2, 2024 · 0 comments · Fixed by #308

Comments

@fzhinkin
Copy link
Collaborator

fzhinkin commented May 2, 2024

Currently, there's no way to read a code point from a source containing UTF-8 encoded data or write a single code point to sink encoding it to UTF-8 along the way.

Corresponding functions exist but are hidden: #136 (comment)

It's time to make them public under the following names:

  • Sink.writeCodePointValue(value: Int)
  • Source.readCodePointValue(): Int

There is no Utf8 in the names for consistency with readString/writeString, but there is a Value suffix.
At some point, CodePoint type will be added to Kotlin Stdlib, so it'll be nice to preserve readCointPoint/writeCodePoint names for it. However, such a type most likely will have a value: Int property and the names mentioned above are referring to that property.

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

Successfully merging a pull request may close this issue.

1 participant