The strings are created using the following:
new String(bytearray, offset, size, "UTF-8")
and to fix the bug it must be created using:
StringBuffer sb = new StringBuffer();
for (int i = offset; i < offset + size; i++) {
sb.append(new String(bytearray, i, bytearray[i] < 0 ? 2 : 1, "UTF-8"));
if (bytearray[i] < 0){ i++; }
}
String txt = sb.toString();
A tiny bug, and a very ugly fix ;)
Lula
No comments:
Post a Comment