Skip to content

Have ToJson() match the default formatter's escaping behavior - #8

Open
nblumhardt-ro wants to merge 1 commit into
datalust:devfrom
nblumhardt-ro:friendlier-literal-json
Open

Have ToJson() match the default formatter's escaping behavior#8
nblumhardt-ro wants to merge 1 commit into
datalust:devfrom
nblumhardt-ro:friendlier-literal-json

Conversation

@nblumhardt-ro

Copy link
Copy Markdown

System.Text.Json's default formatting also escapes for HTML and anything non-ASCII (which makes sense as a defense-in-depth strategy in web apps). This doesn't work for a formatting library: content with +, with non-Latin character sets, etc., becomes unreadable.

The PR relaxes this to regular safe JSON escaping (the Unsafe*** is a misnomer, in my humble opinion, but a good signpost to make us think, I guess).

… unusable for non-Latin languages, otherwise).

Assisted-by: Claude:claude-fable-5-1
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