WeiDUorg / weidu

WeiDU is a program used to develop, distribute and install modifications for games based on the Infinity Engine.
http://www.weidu.org
GNU General Public License v2.0
86 stars 19 forks source link

Printing error #161

Closed LionXavier closed 4 years ago

LionXavier commented 4 years ago

There seems to be a printing error with WeiDU. When I command it to print the character "º", it produces the following: "º". Also, the REPLACE_TEXTUALLY command doesn't recognice that character "º", EXACT_MATCH being used or not.

I found this issue while editing a string in dialog.tlk (IWD2 Spanish version) through WeiDU. I'm using the latest version of the program (Version 246); I don't remember this issue existing in previous versions, but I could be mistaken.

Tried with both "amd64" and "x86" executables, same result.

FredrikLindgren commented 4 years ago

Please verify that you are using the same, and correct, character encoding across your text file, the game and your command prompt or shell.

I'm reasonably certain WeiDU works correctly. Your problem with the character being printed incorrectly sounds very much like you are printing to a different character encoding (with no conversion).

LionXavier commented 4 years ago

You were completely right. It turns out my .tp2 file was saved with UTF-8 encoding; I saved it with ANSI and it worked perfectly. When did this damned Windows notepad start saving .txt files with UTF-8 by default!?

Thank you for your quick assistance, FredrikLindgren.

GwendolyneFreddy commented 4 years ago

I got this issue too a few years ago: Notepad++ settings convert all loaded files into UTF-8 by default. You must uncheck this box to keep files their original encoding when loading and saving them.

4Luke4 commented 4 years ago

When did this damned Windows notepad start saving .txt files with UTF-8 by default!?

You might want to use a more professional source code editor like Visual Studio Code or Atom...

LionXavier commented 4 years ago

I got this issue too a few years ago: Notepad++ settings convert all loaded files into UTF-8 by default. You must uncheck this box to keep files their original encoding when loading and saving them.

If only I were using Notepad++. I'm using just the plain and simple Windows Notepad, and I distinctly remember this not being an issue in the past; heck, I have test mods that have "º" from a couple year back that I know installed smoothly then.

Funny thing is, before FredrikLindgren gave me the clue I'd already sorted the problem out with a "witty" workaround:

Then it produced the result I wanted. And then I edited it back to normal after reading FredrikLindgren response and figuring it all out.

You might want to use a more professional source code editor like Visual Studio Code or Atom...

You may be right. The thing is that, since I got into modding, I've sort of been doing things on the fly, and it's hard to break a habit. I got by learning very specific things one after another, borrowing pieces of other people's codes... basically trying to get things to work as I wanted, and only lately I've begun (slightly) caring about code efficiency.

But in the end all of this has paid off, really. I have a little project that has been in the works for some time now, only a couple of last touches left, that I'm very proud of: a mod for Icewind Dale 2 that restores the (human/half-orc) monk's appearance and unarmed attacks (as in BG2) and gives them abilities like Flurry of Blows and Abundant Step that per 3.0 D&D rules they should've had. I've managed to make the one-handed, two-handed and unarmed attacks animations for monks able to coexist and work properly which, as anyone experienced with Infinity Engine's (not EE) inner workings know, it's not an easy accomplishment. Remember, you heard about it here first!

Anyways, it's encouraging to know that such an attentive support still exists for this tool that, powerful as it is, is intended for an already old game engine. Thanks to all of you.