fix: preserve Unicode characters in Pretty JSON formatting#7731
Open
sfmskywalker with Copilot wants to merge 2 commits into
Open
fix: preserve Unicode characters in Pretty JSON formatting#7731sfmskywalker with Copilot wants to merge 2 commits into
sfmskywalker with Copilot wants to merge 2 commits into
Conversation
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix display of Unicode characters in Pretty JSON view
fix: preserve Unicode characters in Pretty JSON formatting
Jun 17, 2026
sfmskywalker
marked this pull request as ready for review
June 21, 2026 17:29
Contributor
|
PR author is not in the allowed authors list. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Pretty JSON rendering was escaping non-ASCII characters (e.g.,
ÆØÅ) into\uXXXX, while raw JSON showed readable text. This change aligns formatter output with expected human-readable Unicode rendering.Scope
Select one primary concern:
Description
Problem
Pretty JSON output used default serialization behavior in
JsonFormatter.ToStringAsync, causing non-ASCII characters to be emitted as escaped Unicode sequences, reducing readability in JSON viewer pretty mode.Solution
JsonFormatternow serializes using its configured_optionsinstead of defaultJsonSerializer.Serialize(value).JavaScriptEncoder.Create(UnicodeRanges.All)to formatter options to preserve readable Unicode text.JsonFormatterTests.ToStringAsync_DoesNotEscapeUnicodeCharactersto assertÆØÅremains unescaped.Verification
Steps:
{"name":"ÆØÅ"}).ÆØÅ(not\u00C6\u00D8\u00C5).Expected outcome:
Pretty and Raw views both display readable Unicode characters for non-ASCII content.
Screenshots / Recordings (if applicable)
Commit Convention
We recommend using conventional commit prefixes:
fix:– Bug fixes (behavior change)feat:– New featuresrefactor:– Code changes without behavior changedocs:– Documentation updateschore:– Maintenance, tooling, or dependency updatestest:– Test additions or modificationsClear commit messages make reviews easier and history more meaningful.
Checklist