Skip to content

Correctly handle negative code point values #317

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

Merged
merged 2 commits into from
May 8, 2024

Conversation

fzhinkin
Copy link
Collaborator

@fzhinkin fzhinkin commented May 7, 2024

Follow up on #308

@@ -510,6 +514,12 @@ private fun Buffer.commonWriteUtf8(string: String, beginIndex: Int, endIndex: In

private fun Buffer.commonWriteUtf8CodePoint(codePoint: Int) {
when {
codePoint < 0 || codePoint > 0x10ffff -> {
throw IllegalArgumentException(
"Code point value is out of Unicode codespace [0, 0x10ffff]: 0x${codePoint.toHexString()} ($codePoint)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a syntax for inclusive ranges in Kotlin: "a..b"

@fzhinkin fzhinkin merged commit dbac7e9 into develop May 8, 2024
1 check passed
@fzhinkin fzhinkin deleted the handle-negative-values-in-write-utf8-cp branch May 8, 2024 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants