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.
@ -545,14 +568,14 @@ implementation wrapping the QuickJS engine.
**Possible Issues**
Code that previously successfully evaluated using JavascriptEngine::evaluate()
or JavascriptEngine::execute(), could now fail due to the rules applied by the
new, much more standards compliant engine. One example is object literals
or JavascriptEngine::execute(), could now fail due to the rules applied by the
new, much more standards compliant engine. One example is object literals
e.g. { a: 'foo', b: 42, c: {} }. When evaluated this way the new engine will
assume that this is a code block and fail.
**Workaround**
When calling JavascriptEngine::evaluate() or JavascriptEngine::execute() the
When calling JavascriptEngine::evaluate() or JavascriptEngine::execute() the
code may have to be updated to ensure that it's correct according to the
Javascript language specification and in the context of that evaluation. Object
literals standing on their own for example should be wrapped in parentheses