ClassiCube server list interprets server names as CP437 instead of Unicode
-
The web server list API outputs a JSON containing
"ClassiCube Espa\u00f1ol". -
\u00f1should get escaped to the Unicode characterU+00F1 ñ. The web server list does this (ClassiCube Español). -
The ClassiCube client's server list interprets it as CP437 character
0xF1 ±which would be very much incorrect (ClassiCube Espa±ol).
If you feed it a character whose Unicode codepoint is U+0100 or up, there's an error telling you that Only first 256 unicode codepoints may be used in server names. This is all cool and good since, you know, CP437 only defines 256 characters, and the Minecraft Classic font and chat uses CP437... But it directly mentions "Unicode codepoints". Unicode codepoints aren't equivalent to CP437 codepoints. This makes it incorrect I think.
The documentation does not mention the encoding you're supposed to use, nor does it mention this error.
Other testing
U+00F1 ñ and U+00D7 × gets converted to CP437 in-game, and shows up as U+00B1 ± and U+256B ╫.
If the correct character to display is ╫, then its Unicode codepoint does NOT fit the range mentioned by the error, and as such should not be accepted by the master server if we were to take the error literally :)
TL;DR
- The server list JSON API outputs as ASCII and uses Unicode escape characters within the JSON strings (
\uxxxx).- I'm fairly certain the API accepts UTF-8 for server names from server heartbeats (which should be interpreted as Unicode?)
- Server list restricts accepted Unicode codepoints to
U+0000-U+00FF. The error for this directly mentions Unicode codepoints, implying that the characters are meant to be Unicode.
- Website server list interprets it as Unicode.
- ClassiCube interprets it as CP437.
- Documentation does not mention which encoding is correct for implementations.
- All website interaction uses UTF8 encoding
- The restriction on name being first 256 unicode characters is not to do with Code Page 437, but rather the encoding used to store the server's name in the website's database
- ClassiCube was meant to convert from unicode to code page 437 in JSON strings, I just forgot to do it:
- Latest commit of ClassiCube now properly interprets (and thus renders) code page 437 characters
- Latest commit of MCGalaxy now accepts more code page 437 characters for server name (https://github.com/ClassiCube/MCGalaxy/blob/1b2dc96d5ef9db59426192779b663cd3a2243f88/MCGalaxy/Server/ServerConfig.cs#L330)