Closed GoogleCodeExporter closed 9 years ago
The problems seams to be due to a bug in constructor String(byte[], String),
for example this code:
byte[] bytesData = {-62, -93, -30, -126, -84};
try {
final String result = new String(bytesData, "UTF-8");
System.out.println("GOT: " + result);
byte[] butNow = result.getBytes("UTF-8");
for (int i = 0; i < butNow.length; i++) {
System.out.println("[" + i + "] = " + butNow[i]);
}
Display.getInstance().callSerially(new Runnable() {
public void run() {
Dialog.show("Result in UI", result, "Ok", null);
}
});
} catch (UnsupportedEncodingException ex) {
ex.printStackTrace();
}
prints out on simulator:
GOT: £€
[0] = -62
[1] = -93
[2] = -30
[3] = -126
[4] = -84
but the new iOS VM prints:
2015-01-16 13:44:00.090 MyApplication[55021:c03] GOT: ᅡᆪ¬ツᆲ
2015-01-16 13:44:00.092 MyApplication[55021:c03] [0] = -17
2015-01-16 13:44:00.093 MyApplication[55021:c03] [1] = -65
2015-01-16 13:44:00.094 MyApplication[55021:c03] [2] = -126
2015-01-16 13:44:00.095 MyApplication[55021:c03] [3] = -17
2015-01-16 13:44:00.096 MyApplication[55021:c03] [4] = -66
2015-01-16 13:44:00.097 MyApplication[55021:c03] [5] = -93
2015-01-16 13:44:00.098 MyApplication[55021:c03] [6] = -17
2015-01-16 13:44:00.099 MyApplication[55021:c03] [7] = -65
2015-01-16 13:44:00.100 MyApplication[55021:c03] [8] = -94
2015-01-16 13:44:00.101 MyApplication[55021:c03] [9] = -17
2015-01-16 13:44:00.102 MyApplication[55021:c03] [10] = -66
2015-01-16 13:44:00.103 MyApplication[55021:c03] [11] = -126
2015-01-16 13:44:00.103 MyApplication[55021:c03] [12] = -17
2015-01-16 13:44:00.104 MyApplication[55021:c03] [13] = -66
2015-01-16 13:44:00.105 MyApplication[55021:c03] [14] = -84
Original comment by jaanus.h...@gmail.com
on 16 Jan 2015 at 11:50
Thanks, this was triggered by a bug in an optimization for ascii characters
which is now fixed.
Original comment by shai.almog
on 20 Jan 2015 at 12:10
Original issue reported on code.google.com by
appsepp....@gmail.com
on 14 Jan 2015 at 4:44Attachments: