[9.0a x32] Wrong encoding of Russian buttons and listboxes

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

[9.0a x32] Wrong encoding of Russian buttons and listboxes

Post by *MVV »

I've noticed that 32-bit TC 9.0a sometimes shows Russian localization incorrectly when non-Unicode language is set to English (US). All looks fine with standard Russian localization (WCMD_RUS.LNG) but with my custom one dialog buttons and listbox items are displayed in wrong encoding (in 1252 instead of 1251).

Bug may also be reproduced with this simple LNG file:

Code: Select all

MIME-Version: 1.0
Content-Type: application/octet-stream; name="WCMD_BUG_RUS.7z"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="WCMD_BUG_RUS.7z"

N3q8ryccAAMUVDS3BAEAAAAAAABiAAAAAAAAAFJNSPkAKR1KeGkxFRJA4S625F6uB5geAUYWisVA
L1Z9Qcw2En6egmhUikVfk+1fJZs6LCYUqZkMBkcPEY7ZNa3cbp3wU7O5SuPElY5n7s/V5Fz+/vBs
r726JAqvdvBO3rRQSqOkEK/abj38e5M2xFmyUlSbPt11U98qw06tKegZgfXBgdlGHRfnDnSKLS4q
eWKMN2OkRyakjvmsH/6wD33KRwkjdJdgvvYJmK7wpFUJEGP0HfaOSbRsmAIexrsfiGHtr6/mSMcL
sfkjUW4uRubA19sYPSOcAgFBg1mXX5V8MyGBesMX7vTTb2YfeLKUaZKWuBnLkBjve2kFQkpNAv/c
2NZmy6/gAAEEBgABCYEEAAcLAQABIwMBAQVdAAABAAyBUAAICgFA3fsAAAAFAREjAFcAQwBNAEQA
XwBCAFUARwBfAFIAVQBTAC4AbABuAGcAAAAUCgEAwwQKGM1W0gEVBgEAIAAAAAAA
It contains F-button text that is displayed correctly and some other strings that are displayed incorrectly (configuration dialog pages, 'Change plugin attributes:' checkbox of attributes dialog).

Screenshot

It seems that problem has been introduced in TC 9.0a RC2 (all looks fine in TC 9.0a RC1), perhaps due to this change:
02.12.16 Fixed: Classic theme: Multi-rename tool buttons "+" and "#" did not show cyrillic characters, just ???? (64)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48005
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks for your report. The two are not related - the bugfix you listed was just in the 64-bit version, and only affected the main menu, and only with classic theme.

This one here only seems to affect the 32-bit version, and also with Windows 7 default theme.

The problem you have may be caused by incomplete or incorrect strings. I will check it in the debugger. I will have to check that in the debugger. However, none of the included languages seems to cause this problem, so it's not that critical.
Author of Total Commander
https://www.ghisler.com
VSB
Member
Member
Posts: 136
Joined: 2006-12-12, 12:02 UTC
Location: Russia

Post by *VSB »

That may be if somewhere SetDlgItemTextA is used instead of SetDlgItemTextW
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

It is strange that it only appears since 9.0Ra C2 while all dialogs support Unicode for years... Also it appears not always but under some circumstances, perhaps in case when LNG is incomplete - I'll try to add missing lines to my custom localization.
VSB
Member
Member
Posts: 136
Joined: 2006-12-12, 12:02 UTC
Location: Russia

Post by *VSB »

2MVV
What is _real_ LNG file encoding? Is it the same with one specified at file beginning?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48005
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

2MVV
I found the problem - I tried to fix some other problem, but this causes the encoding to be set to CP_ACP when a string isn't found in the LNG file. So any missing string will cause this problem...
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

ghisler(Author),
Yes, I can confirm that adding missing strings helps to avoid the problem.

VSB,
Both files are in codepage 1251 and both define codepage=1251. It is not a file encoding problem because same file works fine in older TC versions.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48005
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This should be fixed in TC 9.10 beta, please test it!
Author of Total Commander
https://www.ghisler.com
Post Reply