verhoevenv/OpenNotrium

Encoding issues

Closed this issue · 6 comments

This one is going to be fun.

At least on Windows both the title screen and the credits screen don't show the ö character in Mönkkönen.

The source files define ö, å and non-ASCII characters as char literals (see text_output.cpp).

I'm surprised it even compiles.

Well, the compiler would have no need to complain if it were using an extended character set. But you're right, I've seen strange things happening in linux as well. I also point out that MageKing17 had a similar problem with non-ASCII characters, and the issue might be correlated. http://www.instantkingdom.com/forum/viewtopic.php?t=2254001&post=5895072528728064#5895072528728064
I propose we enforce UTF-8 in "visual" text strings and pass a pointer to a UTF-8 character position. The only problem left would be finding and fixing every pieces that read or write these texts.

As shown in #16, this is not fixed yet on Linux. Reopening.

I will try meddling with this next. I honestly didn't like the new code that much, it was throwing too many warnings.

Enet4, do you think #19 will solve it? Or do you have some other solution in mind?

Well, I was precisely thinking about doing that! I will try your fix over here to see if it works.

Edit: All right! Although it doesn't solve #16, this issue is gone in the encoding_gcc branch. The ö's are properly written now.

I may also suggest rendering a dummy character ('?') if the byte code isn't in the valid range, just to identify further "happenings".

This issue should be fixed with the merge of #19.

I believe we will be pretty much unable to correctly read text files or keyboard input with these extended characters at the moment. The default mods don't contain any non-ascii characters (as checked with find | xargs file | grep "text," | grep -v ASCII) but other mods might.

Ah well. We'll solve that issue when we encounter it.