ClassiCube icon indicating copy to clipboard operation
ClassiCube copied to clipboard

ClassiCube server list interprets server names as CP437 instead of Unicode

Open Technochips opened this issue 3 months ago • 2 comments

  • Image

    The web server list API outputs a JSON containing "ClassiCube Espa\u00f1ol".

  • Image

    \u00f1 should get escaped to the Unicode character U+00F1 ñ. The web server list does this (ClassiCube Español).

  • Image

    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

Image Image

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.

Technochips avatar Aug 30 '25 21:08 Technochips

  • 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: Image

UnknownShadow200 avatar Aug 30 '25 21:08 UnknownShadow200

UnknownShadow200 avatar Aug 30 '25 22:08 UnknownShadow200