Skip to content

Conversation

@vojtechtoman
Copy link

@vojtechtoman vojtechtoman commented Oct 10, 2025

The Formatter::write_quoted method doesn't support Unicode code points beyond the BMP (0000-FFFF) correctly. As a result, these codepoints get mangled in the final result. For instance, the character 🤓 (U+1F913 or F0 9F A4 93 in UTF-8) gets written out as \u129299 ("ኒ99") which is incorrect. This PR adds support for any Unicode scalar value in source text as per September 2025 version of the GraphQL spec:

Source Text
SourceCharacter
Any Unicode scalar value

GraphQL documents are interpreted from a source text, which is a sequence of SourceCharacter, each SourceCharacter being a Unicode scalar value which may be any Unicode code point from U+0000 to U+D7FF or U+E000 to U+10FFFF (informally referred to as “characters” through most of this specification).

@vojtechtoman vojtechtoman changed the title Formatting: Fix support for code points beyond BMP (0000-FFFF) Formatter: add support for any Unicode scalar value in source text Jan 9, 2026
@vojtechtoman vojtechtoman reopened this Jan 9, 2026
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.

1 participant