*"Hätten Hüte ein ä im Namen, wären sie möglicherweise keine Hüte mehr, sondern Häte."
72 -61 -92 116 116 101 ...*
GetBytes() returns negative number (-61, () ) at the char 'ä'.
How to get the normal ascii value?
GetBytes() returns negative number (-61, () ) at the char 'ä'.
Well getBytes()
is going to use the platform default encoding, unless you specify an encoding, which you should. I would recommend UTF-8 normally. For example, in Java 7:
byte[] data = text.getBytes(StandardCharsets.UTF_8);
byte
in Java is unfortunately signed - but you can think of it as being just 8 bits. If you want to see the effective unsigned, just use:
int unsigned = someByte & 0xff;
How to get the normal ascii value?
That character doesn't exist in ASCII. All ASCII characters are in the range U+0000 to U+007F.
See more on this question at Stackoverflow