Hebrew name in the title of the game / setup and saves folder shows in gibberish

Started by Gal Shemesh, Sun 13/08/2023 11:55:16

Previous topic - Next topic

Gal Shemesh

Hi everyone,

I'm helping a friend to migrate his game from AGS 2.72 to the recent official 3.6.0 release. I've managed to overcome many issues while migrating from one version to the other, until I'm finally able to run the game in the recent release.

The main tedious problem I found so far was that I had to re-write the names of all of the rooms, as they were in Hebrew and in the recent version of the editor they appeared as gibberish. And just copying the original Hebrew text from the old editor and pasting it in the new remained in gibbrish. So that's done now. But I'm still facing issues displaying the Hebrew game name correctly.

Currently, the game name in the title bar and in the Setup window, which was originally showing correctly in Hebrew, appears in gibberish. In addition, I've just found that even the 'Save games folder name' under 'C:\Users\%username%\Saved Games' doesn't show correclty but as 'dashes' ( ________ ), instead of a Hebrew name.

I've went through the General Settings and found that the game was originally set to text format: ASCII / ANSI. However, I find that it uses TTF fonts in the game folder (as the agsfnt0.ttf and agsfnt1.ttf files are present there).

I found that the only place that uses these fonts within the game is the save/load GUI. If I run the game as it is, the GUI shows in Hebrew correctly. But as I mentioned, the game title at the top bar of the AGS window shows in gibberish. However, if I change from ASCII / ANSI to Unicode (UTF-8), the game title shows correctly (while the title of the Setup window still remains in gibberish), but then the save/load GUI now shows in gibberish...

So far I've changed the game to show its text in Unicode (UTF-8) and overcame many of the issues in the scripts - which in include Hebrew strings in them, and most of the game is now showing correctly, apart from the title matter which probably also affects the name of the games save folder.

Would appreciate any assistance.

Thanks
Gal Shemesh,
goldeng

Crimson Wizard

1. The window title is assigned a unicode string in 3.6.0, this is done unconditionally now. Therefore, if a game title is saved in ANSI and contains non-latin letters, it will display as gibberish.

I think it's possible to fix in windows version of the engine, because windows API provides methods for both unicode and ANSI string parameters. But:
* this will work only on Windows, because other systems (linux etc) don't know how to display ANSI.
* this will work only on Windows systems which have "language for non-Unicode applications" set to Hebrew, or possibly ones which default language uses same ANSI charset as Hebrew.
On all the other systems this text will still display wrong.

2. The winsetup issue is because the window title is taken from the config file ("titletext" option), which is generated having ANSI encoding by the editor. This is something that I missed when was adding Unicode support to the Editor, assuming that the config file does not store human-readable text.

This should be fixed, and config file likely has to always be saved in utf-8. The engine may take care of it regardless what encoding the game requires.

3. The save folder name. Since some time the engine forces the save folder name to have only chars in certain code range, I think this is 32 - 127, with exceptions for punctuation signs. If there's any chars outside of that range, they are replaced by underscores '_'. This is done for compatibility between various systems. So, at the moment, it seems like you cannot have save folders named in Hebrew.

SMF spam blocked by CleanTalk