Skip to content

Wrote valid UTF-8 in JSON strings as-is instead of escaping each byte - #9

Open
djbclark wants to merge 1 commit into
masterfrom
fix/json-encode-raw-utf8
Open

djbclark wants to merge 1 commit into
masterfrom
fix/json-encode-raw-utf8

Conversation

@djbclark

Copy link
Copy Markdown
Owner

JsonEncodeStringWriter() escaped each non-ASCII byte as \u00XX, which conformant parsers read as a code point: café came back as café in Python and jq. Valid UTF-8 is now written raw (RFC 8259 §7); anything else keeps the old byte escape, so libntech's own decoder still round-trips old and new output unchanged.

Tests: new test_string_escape_utf8 (fails without the fix); libntech make check 39/39 programs; cfengine/core unit tests built against this commit: 70 pass, 3 expected XFAIL, 1 skip. No core test expects the old escaping.

Fork-internal PR for CI; not an upstream submission.

🤖 Generated with Claude Code

A \uXXXX escape denotes a code point (RFC 8259 section 7), so "café" was
read as "café" by other parsers; bytes that are not valid UTF-8 are
still escaped as before.

Changelog: Title
Signed-off-by: Daniel JB Clark <djbclark@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approved. Cursor Bugbot was not present after the first check poll, so that signal was skipped; remaining signals and policy files do not require human review. No reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

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