livicitu commented on code in PR #2698:
URL: https://github.com/apache/activemq/pull/2698#discussion_r4511981137
##########
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:
Thanks both, done in fd8060f.
@cshannon the new branch uses braces now. I left the rest of the method as
it is, to keep the diff on the change, and can do the whole method in a
follow-up PR.
@tabish121 agreed. ActiveMQ-CPP sends the bytes of the string it's given, so
the four-byte form comes from the application that put standard UTF-8 there.
I've reworded the comment, and the test's, to say so.
--
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