Consider the simple example:
System.out.println("¬");
System.out.println((int)(('¬')));
System.out.println((char)170);
The output I get is as follows (in order from the sample code):
¬
172
ª
Why is this occurring? I looked into the ASCII chart for character 170, and it says that it is indeed a ¬. Even (on Windows), when one does Alt+170, I get ¬.
Is there something that I’m missing?
Java’s (internal) default charset is UTF-16 (Unicode).
170 decimal is AA hex, so your character is FEMININE ORDINAL INDICATOR, see here.
The documentation of Primitive Data Types states:
char: The char data type is a single 16-bit Unicode character. It has a minimum value of ‘\u0000’ (or 0) and a maximum value of ‘\uffff’ (or 65,535 inclusive).