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!

Moderators: GZDoom Developers, Raze 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.
Post Reply
User avatar
Xane123
Posts: 165
Joined: Tue Nov 24, 2015 1:58 pm
Graphics Processor: nVidia (Modern GZDoom)
Location: Inwood, WV
Contact:

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

Post by Xane123 »

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.
GZDoom's display of accented characters. The "^" and weird block are supposed to be "\n", a new line.
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 all

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 68 times
User avatar
Xane123
Posts: 165
Joined: Tue Nov 24, 2015 1:58 pm
Graphics Processor: nVidia (Modern GZDoom)
Location: Inwood, WV
Contact:

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

Post by Xane123 »

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
phantombeta
Posts: 2088
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

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

Post by phantombeta »

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
Xane123
Posts: 165
Joined: Tue Nov 24, 2015 1:58 pm
Graphics Processor: nVidia (Modern GZDoom)
Location: Inwood, WV
Contact:

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

Post by Xane123 »

The "Ê" is being interpeted correctly here!
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...
Post Reply

Return to “Assets (and other stuff)”