Conquest of Elysium 4

Conquest of Elysium 4

Marlin 2 Feb, 2016 @ 12:30pm
CoE4 seems to accept UTF-8 in mods and maps
Yay! I just realized that CoE4 accepts UTF-8 in both mod and map files (c4m and coem files). Meaning, in theory, you might use any Unicode character in whatever descriptions and names you have in those files. In practice, some characters won't work, of course. The font files used by the game won't have glyphs for them all, to begin with. (Oddly, the Unicode emoticons block, beginning at U+1F600, does appear to be in the sans font, yet doesn't seem to work anyway, for some reason.)

Until now I had kind of assumed that only ASCII text worked in CoE, but it seems that full UTF-8 (/Unicode) is basically supported in CoE4. (ASCII does work, obviously, as any legal ASCII file is legal UTF-8 too.) By comparison, CoE3 seems to use the legacy Latin 1[en.wikipedia.org] 8-bit character encoding, I think, or something similar.

Unless I have completely misunderstood something.

Note: The UTF-8 should be clean and unpolluted by any pointless BOM garbage.
UTF-8 with BOM does not seem to work.

Edit: Nothing odd about the Unicode Emoticons block not showing up. It's not in the font.
Last edited by Marlin; 7 Feb, 2016 @ 3:33pm
< >
Showing 1-3 of 3 comments
Marlin 7 Feb, 2016 @ 3:35pm 
Sorry, I was wrong about the Unicode Emoticons block being in the sans font of the game (managed to mix it up with another font). So nothing odd about those characters not possible to display. The only smilies I can find in the font are U+2639 and U+263A (these two: ☹ ☺ ), in the Unicode Miscellaneous Symbols block.

Still, I believe there's some more both fun and useful stuff is in there.
Marlin 19 Feb, 2016 @ 4:19pm 
Small update: Just for fun I made the experiment of substituting the DejaVuSans font (from the DejaVu fonts project[en.wikipedia.org]) for the guifont.ttf provided with the game (which, by the way, seems to be FreeSans from the GNU FreeFont[en.wikipedia.org] family). DejaVuSans does contain glyphs for emoticons beginning at U+1F600 – like 😀😁😂 etc. – but, sadly, the game refused to show them. So there does seem to be a bug here after all (some legacy UCS-2 in the SDL Fonts library perhaps?), just not a bug that matters, since the fonts with the game don’t have those symbols anyway.

Display of characters from the old, 16-bit so called BMP of Unicode worked without a problem, on the other hand. Thus, with DejaVuSans – and also with FreeSerif (GNU FreeFont) – I got Dingbats and Miscellaneous Symbols like these displayed: ❶❷❸❹ ⚔ ☠ ⚕ ✌ ☄ ⚓ ⚒ ⚠ ⚑ ⚐ ➳ ☛ ✔ ✘ ⚅ ♒ ☼ ☀ ☁ ⚡ ❄ ☃ ♨ ☤ ⚚ (which aren’t in the FreeSans that comes with the game). This too is of purely academic interest, of course. ☺
Marlin 28 Feb, 2016 @ 8:15pm 
...And yet another update: I have now actually managed to make the game display those emoticons beyond the 16-bit BMP of Unicode (U+1F600 etc.) that I have been babbling about (and also some ancient Egyptian hieroglyphs). Though not with the fonts supplied with the game, of course.

The reason for my earlier failure was entirely to be found within the SDL ttf library. Which was what I suspected.

To find the final answer, I actually downloaded the source code for that library (I can be a bit obsessive like that sometimes), and, although it nicely handles things the modern UTF-8 way internally (everything not UTF-8 is converted to UTF-8 before further processing), it despite this had some places where good Unicode was sadly cut down to 16 bits. After I had found and fixed those, and compiled the fixed library – tada! – the game could suddenly show those elusive characters (with the right font).

I have now contacted the SDL guys to see if those fixes can somehow be added to the official SDL ttf library.

It still is all of purely academic interest, of course. 😎
Last edited by Marlin; 28 Feb, 2016 @ 8:22pm
< >
Showing 1-3 of 3 comments
Per page: 1530 50