jmestwa-coder opened a new pull request, #678: URL: https://github.com/apache/logging-log4cxx/pull/678
## Summary Normalize invalid Unicode scalar values before emitting JSON string content in `JSONLayout`. This change ensures surrogate-range and out-of-range Unicode values are emitted as `\ufffd` instead of passing through as raw non-scalar content. ## What changed - Added centralized normalization for invalid Unicode scalar values in `JSONLayout::appendItem` - Replaced surrogate-range (`U+D800`–`U+DFFF`) and out-of-range code points with `U+FFFD` - Updated `JSONLayoutTest::testAppendQuotedEscapedString` to verify normalized output behavior ## Why `JSONLayout` already replaces malformed decode sequences with `U+FFFD`, but surrogate-range scalar values could still bypass escaping through the fast-path serialization logic. This could produce non-interoperable JSON output containing invalid Unicode scalar values. The fix keeps behavior unchanged for valid input while ensuring malformed scalar values are consistently normalized before JSON emission. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
