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

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.
odd_accents.png
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)
You do not have the required permissions to view the files attached to this post.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

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

Post by Gez »

User avatar
Xane123
Posts: 165
Joined: Tue Nov 24, 2015 1:58 pm
Graphics Processor: nVidia (Modern GZDoom)
Location: Inwood, WV

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: 2188
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

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

Post by Xane123 »

fixed_thanks.png
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...
You do not have the required permissions to view the files attached to this post.

Return to “Assets (and other stuff)”