GetBytes () returns a negative number (-61, ()) in char 'ä'.
Well getBytes() will use the default encoding for the platform, unless you specify the encoding you should. I would recommend UTF-8 ok. For example, in Java 7:
byte[] data = text.getBytes(StandardCharsets.UTF_8);
Java byte is unfortunately signed, but you can think of it as 8 bits. If you want to see an effective unsigned character, simply use:
int unsigned = someByte & 0xff;
How to get normal ascii value?
This character does not exist in ASCII. All ASCII characters are in the range U + 0000 to U + 007F.
source share