Is there a way to fix GZDoom's broken accented characters?

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Is there a way to fix GZDoom's broken accented characters?

Postby Xane123 » Fri Jul 20, 2018 4:46 pm

Today, I found someone on Twitter that is saying they localize to Portuguese, which interested me as my game could be better with more languages due to ZDoom's LANGUAGE lump. However, I tried inserting a Portuguese text string into the game and it seems GZDoom can't render anything beyond normal letters, numbers, and symbols; If it ever tries to write something like the multiplication sign or an accented character, it gets replaced with an incorrect character. Strangely, "new line" commands (\n) break on this string too, becoming a weird square with a circle inside it on a bitmap font and two upward arrows on the console font.
odd_accents.png
GZDoom's display of accented characters. The "^" and weird block are supposed to be "\n", a new line.

I would say this is definitely a bug but I bet someone will come tell me that this isn't one, so I'm just posting here to ask if there's any way I can get non-English text to appear correctly; Both fonts have accented characters so they should be displaying correctly; Attached is a demonstration WAD that writes this string to the screen in both fonts:
Code: Select allExpand view
TEST = "Isto é uma demonstração. O ZDoom não\n"
      "exibe caracteres acentuados\n"
      "corretamente.";

It can't be the text file format as GZDoom displays an error if the format isn't ANSI, saying a character is invalid ASCII (then a negative number)
Attachments
strange_text.wad
This is a demonstration WAD that writes a sentence twice with different fonts. Both fonts support accented characters but aren't rendering correctly.
(17.35 KiB) Downloaded 20 times
User avatar
Xane123
Mary's Magical Adventure Developer
 
Joined: 24 Nov 2015
Location: Martinsburg, WV
Discord: Xane123#3770


Re: Is there a way to fix GZDoom's broken accented character

Postby Xane123 » Fri Jul 20, 2018 9:08 pm

Looking at that page, they don't look fun to deal with! So, how do I make a language lump make the game use the correct code page? I assumed GZDoom's built-in other languages would be set up properly, but importing the Portuguese one, adding "default enu" to the list of languages at the top of the file, then making "P2TEXT" be written using CONFONT (since that string has accented characters), it still appeared broken in-game.

I can't test it with the normal Portuguese file as typing "language ptb" in the console then restarting doesn't make GZDoom use LANGUAGE.ptb so I can't test without modifying the file, possibly messing up the code page or whatever makes the accented characters break.
User avatar
Xane123
Mary's Magical Adventure Developer
 
Joined: 24 Nov 2015
Location: Martinsburg, WV
Discord: Xane123#3770

Re: Is there a way to fix GZDoom's broken accented character

Postby phantombeta » Fri Jul 20, 2018 9:21 pm

GZDoom uses the Windows-1252 (Windows Western) codepage. To use accented characters, the file needs to be saved in this codepage.
Most modern code editors have a "Save with encoding" option, which you can use to fix the file's encoding.
User avatar
phantombeta
In the meadow of sinful thoughts, every flower's a perfect one
 
Joined: 02 May 2013
Location: The United Soviet Socialist Dictatorship of Hueland
Discord: phantombeta#2461
Twitch ID: phantombeta_
Github ID: Doom2fan
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Is there a way to fix GZDoom's broken accented character

Postby Xane123 » Fri Jul 20, 2018 9:31 pm

fixed_thanks.png
The "Ê" is being interpeted correctly here!

Ah, thanks, that fixed it! I assume if I save the LANGUAGE lump with SLADE 3, it'll revert it to the other character set, breaking any accented characters, but Notepad++ can set the character set, which makes it appear correctly. Thanks for the help!

EDIT: Nope, edited with SLADE 3 and it kept the Ê! Perfect...
User avatar
Xane123
Mary's Magical Adventure Developer
 
Joined: 24 Nov 2015
Location: Martinsburg, WV
Discord: Xane123#3770


Return to Assets (and other stuff)

Who is online

Users browsing this forum: No registered users and 3 guests