I was busy with the source code for an old Java game written in the early nineties. If I remember correctly, it is written for JDK 1.1.
Somewhere in the code, int primitives (ranging from 0 to 120) are converted to characters. Here is an example:
char c = (char)(i+32);
This causes a problem for ints greater than 95. Here is the code and part of the output from the test case:
for(int i = 120; i >= 0; i--)
System.out.println(i + " -> " + (char)(i+32));
Conclusion:
...
100 -> ?
99 -> ?
98 -> ?
97 -> ?
96 -> ?
95 ->
94 -> ~
93 -> }
92 -> |
91 -> {
90 -> z
89 -> y
88 -> x
87 -> w
...
3 -> #
2 -> "
1 -> !
0 ->
The integer value seems to be lost, since the index passes through the boundaries of the normal values โโof characters.
This, apparently, is the main cause of the error on the client side of the game user interface. This encoded integer is sent back to the client, which then performs the inverse operation (subtracting 32 from char and casting to get int back).
, '?' , '?' 95.