tabish121 commented on code in PR #2698:
URL: https://github.com/apache/activemq/pull/2698#discussion_r4494390720
##########
activemq-client/src/main/java/org/apache/activemq/util/MarshallingSupport.java:
##########
@@ -450,6 +450,23 @@ else if (((a = out[s]) & 0xe0) == 0xc0) {
if (((b & 0xC0) != 0x80) || ((c & 0xC0) != 0x80))
throw new UTFDataFormatException();
out[s++] = (char) (((a & 0x0F) << 12) | ((b & 0x3F) << 6) | (c
& 0x3F));
+ } else if ((a & 0xf8) == 0xf0) {
+ // A standard UTF-8 four-byte sequence, U+10000 to U+10FFFF.
Modified UTF-8 never
+ // contains one, since it writes such a character as a
surrogate pair of three-byte
+ // sequences, but OpenWire clients that are not Java, such as
ActiveMQ-CPP, send it as
+ // is. It decodes to the same surrogate pair, so nothing that
decoded before changes.
+ if (count + 2 >= utfSize)
Review Comment:
The comment here is also misleading and put the blame on who sent the
unexpected payload in the wrong place. ActiveMQ-CPP for instance never did
modified UTF-8 encoding as back when that was written it was assumed the
messages were ASCII so it isn't the client that sent the wrong or unexpected
payload it is the user that encoded the string into straight UTF-8 and put the
bytes into the C++ string body.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact