With jdk12
, came Chess symbols (source):
Unicode 11.0.0 introduced the following new features that are now included in JDK 12
[...] 4 blocks for the following existing scripts:
Georgian Extended
Mayan Numerals
ndic Siyaq Numbers
Chess Symbols
With that in mind, I tried to print those characters with the following code, to test the functionality and use those later in a little chess game:
Character.UnicodeBlock block = Character.UnicodeBlock.CHESS_SYMBOLS;
for (int i = 0; i < 1114112; i++) {
char unicode = (char) i;
if(Character.UnicodeBlock.of(unicode) == block) {
System.out.println(unicode);
}
}
However, it is not printing anything. The code works if I replace CHESS_SYMBOLS
with, for instance, ARABIC
. I have java 12.0.1.
Question: Why isn't the above code printing anything ?