mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2025-01-09 00:14:10 -08:00
Fixes unicode character class recognition
This commit is contained in:
parent
b7f1bb58a6
commit
2178ac34e5
|
@ -97,7 +97,7 @@ public class UnicodeHelper {
|
||||||
byte b = bytes[i];
|
byte b = bytes[i];
|
||||||
if (i < bytes.length - 1 && b == bytes[i + 1]) {
|
if (i < bytes.length - 1 && b == bytes[i + 1]) {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
while (i < bytes.length && bytes[i + count] == b) {
|
while (count < 16384 && i < bytes.length && bytes[i + count] == b) {
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
i += count;
|
i += count;
|
||||||
|
@ -137,15 +137,18 @@ public class UnicodeHelper {
|
||||||
count |= pos * digit;
|
count |= pos * digit;
|
||||||
pos *= 0x40;
|
pos *= 0x40;
|
||||||
}
|
}
|
||||||
} else if (b > 32) {
|
} else if (b >= 32) {
|
||||||
b -= 32;
|
b -= 32;
|
||||||
count = decodeByte(encoded.charAt(++i));
|
count = decodeByte(encoded.charAt(++i));
|
||||||
} else {
|
} else {
|
||||||
count = 1;
|
count = 1;
|
||||||
}
|
}
|
||||||
if (count == 1) {
|
if (b != 0 || count < 128) {
|
||||||
buffer[index++] = b;
|
if (index + count >= buffer.length) {
|
||||||
} else if (b != 0) {
|
ranges[rangeIndex++] = new Range(codePoint, codePoint + index, Arrays.copyOf(buffer, index));
|
||||||
|
codePoint += index + count;
|
||||||
|
index = 0;
|
||||||
|
}
|
||||||
while (count-- > 0) {
|
while (count-- > 0) {
|
||||||
buffer[index++] = b;
|
buffer[index++] = b;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user