Go quotes like the other implementations: control characters only #5
Loading…
Reference in a new issue
No description provided.
Delete branch "quote-controls-only"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Work package: https://openproject.home.romaine.life/wp/AHT-204
Broken now: the same value made different lines in Go than in Rust, C, C# and JavaScript. Go quoted with
strconv.Quote, which also escapes printable-looking characters (U+00A0 no-break space, U+200B zero-width space, U+2028 line separator, other non-printing characters); the other four write those as they are. Found by #4's comparison of the new implementations against Go on ~800,000 random inputs. Every parser read both forms back to the same value, so nothing was misread, but one standard means one byte form.Changed
quote(message and values):",\, Go's short escapes, other control characters as\xNN/\uNNNN, everything else as it is: the rule Rust, C, C# and JavaScript already follow.strconv.Unquotestill reads it.testdata/golden.jsongains a case pinning all of it (bare and quoted U+00A0/U+200B/U+2028, a C1 and a C0 control), which every implementation runs; Go adds a unit test for invalid UTF-8.Checked: ci-check's 7 jobs pass: Go, Rust, C (cmake), C# (dotnet), JavaScript (web-app) all write and parse the new case identically.
🤖 Generated with Claude Code