1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

JSON: Fix encoding of BEL character

This commit is contained in:
Anthony Nicholls 2024-07-22 15:04:16 +01:00
parent 0a78fefecb
commit 379afb1e3f
2 changed files with 34 additions and 12 deletions

View file

@ -87,6 +87,29 @@ invokeMethod() non-virtual forces users to add methods with setMethod() instead
of overriding invokeMethod(), which is more compatible with QuickJS.
## Change
The ASCII and Unicode BEL character (U+0007) escape sequence has changed in the
JSON encoder from "\a" to "\u0007".
**Possible Issues**
Reliance on the raw JSON encoded string literal, for example for file comparison,
base-64 encoding, or any encryption, may result in false negatives for JSON data
containing a BEL character between versions of JUCE.
**Workaround**
Use string replace, for example call `replace ("\\u007", "\\a")` on the
resulting JSON string to match older versions of JUCE.
**Rationale**
The JSON specification does not state that the BEL character can be escaped
using "\a". Therefore other JSON parsers incorrectly read this character when
they encounter it.
## Change
The LowLevelGraphicsPostscriptRenderer has been removed.
@ -104,7 +127,7 @@ into your own project/module and use them that way.
**Rationale**
We are not aware of any projects using this functionality. This renderer was
not as fully-featured as any of the other renders, so it's likely that users
not as fully-featured as any of the other renderers, so it's likely that users
would have filed issue reports if they were using this feature.

View file

@ -335,7 +335,6 @@ struct JSONFormatter
case '\"': out << "\\\""; break;
case '\\': out << "\\\\"; break;
case '\a': out << "\\a"; break;
case '\b': out << "\\b"; break;
case '\f': out << "\\f"; break;
case '\t': out << "\\t"; break;