Mojibake or empty items in the main menu

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Mojibake or empty items in the main menu

Post by *Usher »

Prepare for Unicode Oddities:

1. Open one TC instance, change language to internal English.
2. Open another TC instance, switch to dark mode.
3. Go to the first TC instance, change Language to Russian or Ukrainian.
4. Go to TC[2], switch back to normal mode and welcome mojibake in the main menu.

Now test another case with Unicode:
1. Open one TC instance, change language to Romanian or another lng file saved as UTF-8.
2. Open another TC instance, switch to dark mode.
3. Go to the first TC instance, change Language to Russian or Ukrainian.
4. Go to TC[2], switch back to normal mode and welcome empty items in the main menu.

The problem disappears after converting all *.lng, *.mnu and *.inc files to UTF-8 without BOM.

Unicode Control to Commander Chris...
Andrzej P. Wozniak
Polish subforum moderator
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Mojibake or empty items in the main menu

Post by *ghisler(Author) »

Sorry, I cannot fix that. TC has to reload the menu when you switch from/to dark mode, but the menu has to have the same encoding as the language file to work properly.
Author of Total Commander
https://www.ghisler.com
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Mojibake or empty items in the main menu

Post by *Usher »

That's why I did provide a solution:
The problem disappears after converting all *.lng, *.mnu and *.inc files to UTF-8 without BOM.
Andrzej P. Wozniak
Polish subforum moderator
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Mojibake or empty items in the main menu

Post by *ghisler(Author) »

Actually I found a better solution: I keep the name of the previous main menu stored, and use that when changing between light and dark mode. This is better because the rest of the program also keeps the previous language, and no translations need to be changed.
Author of Total Commander
https://www.ghisler.com
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Mojibake or empty items in the main menu

Post by *Usher »

OK. I will test it for sure as it seems to be related to some other observations.
Andrzej P. Wozniak
Polish subforum moderator
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Mojibake or empty items in the main menu

Post by *ghisler(Author) »

I fixed this in the 32-bit version but didn't completely port it over to 64-bit, so it's broken there (always switching to English menu).

Could you please test it with two instances of the 32-bit version? If it works, I will port it over to 64-bit too. Thanks!
Author of Total Commander
https://www.ghisler.com
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Mojibake or empty items in the main menu

Post by *Usher »

Seems to work OK in 32-bit.
There is only some side effect when testing news strings in LNG files - missing strings are displayed from previous LNG rather than from internal English.
Andrzej P. Wozniak
Polish subforum moderator
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Mojibake or empty items in the main menu

Post by *ghisler(Author) »

There is only some side effect when testing news strings in LNG files - missing strings are displayed from previous LNG rather than from internal English.
This only happens when a dialog box is already loaded, e.g. the main settings. Why? The English strings in dialogs are inside of the dialog templates, together with the layout. When translation, they are replaced with the translated strings. When a language is missing a string, that part of the dialog box is not changed, so the previous translation remains. The only way to fix this is to close and re-open the dialog, which is what happens when you switch to English. I do not plan to do this for all languages, it's annoying because you have to save all other changes you made until then.
Author of Total Commander
https://www.ghisler.com
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Mojibake or empty items in the main menu

Post by *Usher »

2ghisler(Author)
I can live with this feature - it's annoying only when testing new TC builds. However, you should force background refresh in 32-bit Lister - just change BG color to yellow and you will see. I will write a separate bug report if needed.
Andrzej P. Wozniak
Polish subforum moderator
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Mojibake or empty items in the main menu

Post by *ghisler(Author) »

2Usher
I cannot find anything regarding Lister in this thread, and I'm not aware of any problems with the Lister background color. Please create a new bug report.
Author of Total Commander
https://www.ghisler.com
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Mojibake or empty items in the main menu

Post by *Usher »

2ghisler(Author)
Done.
Andrzej P. Wozniak
Polish subforum moderator
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Mojibake or empty items in the main menu

Post by *ghisler(Author) »

Sorry, your report was to vague. There is no way I can test all possible combinations now. Moved to "will not be changed".
Author of Total Commander
https://www.ghisler.com
Post Reply