Why is the following displayed different in Linux vs Windows?
System.out.println(new String(\"¿\".getBytes(\"UTF-8\"), \"UTF-8\"));
in Wind
Not sure where the problem is exactly, but it's worth noting that
¿ ( 0xc2,0xbf)
is the result of encoding with UTF-8
0xbf,
which is the Unicode codepoint for ¿
So, it looks like in the linux case, the output is not being displayed as utf-8, but as a single-byte string