Skip to content

Fix bug in escaped characters - #128

Merged
jecisc merged 1 commit into
developmentfrom
fix-bug-escape
Sep 21, 2026
Merged

jecisc merged 1 commit into
developmentfrom
fix-bug-escape

Conversation

@jecisc

@jecisc jecisc commented Sep 21, 2026

Copy link
Copy Markdown
Member

Escaped characters in JSON string could have bugs during the decoding. This fixes it and add test cases

Escaped characters in JSON string could have bugs during the decoding. This fixes it and add test cases
@jecisc

jecisc commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

For more details:

The writer was encoding some characters wrongly:

  • CR was written as \n — wrong, JSON spells CR as \r
  • LF, " and \ were not escaped at all

For the reader: it did no escape decoding: on \ it simply dropped the backslash and kept the next character. So:

  • \n re-read as literal n
  • \r re-read as literal r
  • raw LF survived by accident

@jecisc
jecisc merged commit 538b231 into development Sep 21, 2026
5 checks passed
@jecisc
jecisc deleted the fix-bug-escape branch September 21, 2026 15:09
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