Skip to content

Conversation

@runlevel5
Copy link

Preserve <, >, and & characters instead of escaping them to unicode equivalents (\u003c, \u003e, \u0026) during encrypt/decrypt cycle.

Replace json.Marshal with custom quoteBytes implementation that only escapes characters required by JSON spec (quotes, backslashes, control characters) without HTML-safety escaping.

Fixes #226

Preserve <, >, and & characters instead of escaping them to unicode
equivalents (\u003c, \u003e, \u0026) during encrypt/decrypt cycle.

Replace json.Marshal with custom quoteBytes implementation that only
escapes characters required by JSON spec (quotes, backslashes, control
characters) without HTML-safety escaping.
@runlevel5
Copy link
Author

runlevel5 commented Jan 14, 2026

Alternatively we could try to ask upstream github.com/dustin/gojson to have disable characters escaping option but I think it makes more sense to handle this edge case downstream

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.

Special characters break encrypt/decrypt

1 participant