swebb2066 commented on code in PR #686:
URL: https://github.com/apache/logging-log4cxx/pull/686#discussion_r3295753892
##########
src/main/cpp/jsonlayout.cpp:
##########
@@ -223,18 +223,21 @@ void JSONLayout::appendItem(const LogString& input,
LogString& buf)
{
auto lastCodePoint = nextCodePoint;
auto ch = Transcoder::decode(input, nextCodePoint);
+ bool escapeReplacement = false;
if (nextCodePoint == lastCodePoint) // failed to decode input?
{
nextCodePoint = input.end();
ch = 0xFFFD; // The Unicode replacement character
+ escapeReplacement = true;
}
else if ((0xD800 <= ch && ch <= 0xDFFF) || 0x10FFFF < ch)
{
ch = 0xFFFD; // The Unicode replacement character
+ escapeReplacement = true;
}
else if (0x22 == ch || 0x5c == ch) // double quote or backslash?
;
- else if (0x20 <= ch) // not a control character?
+ else if (!escapeReplacement && 0x20 <= ch) // not a control
character?
Review Comment:
This change does nothing as `escapeReplacement` is always `false` in this
conditional expression.
--
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]