afs commented on code in PR #2818:
URL: https://github.com/apache/jena/pull/2818#discussion_r1827406503
##########
jena-base/src/main/java/org/apache/jena/atlas/io/BlockUTF8.java:
##########
@@ -135,13 +135,32 @@ private static void toCharsBuffer(ByteBuffer bb,
CharBuffer cb) {
if ( (x & 0xF8) == 0xF0 ) {
// Looking like 4 byte character.
// 11110zzz => 4 bytes.
- int ch = readMultiBytes(bb, x & 0x08, 4);
+ int ch = readMultiBytes(bb, x & 0x07, 4);
char chars[] = Character.toChars(ch);
cb.put(chars);
idx += 4;
continue;
}
+ if ( (x & 0xFC) == 0xF8 ) {
+ // 111110zz => 5 bytes.
+ int ch = readMultiBytes(bb, x & 0x03, 5);
+
+ char chars[] = Character.toChars(ch);
+ cb.put(chars);
+ idx += 5;
+ continue;
+ }
+ if ( (x & 0xFE) == 0xFC ) {
+ // Looking like 4 byte character.
+ // 11110zzz => 4 bytes.
Review Comment:
Yes, it should.
--
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]