[9.20rc3] wfx-plugins not available with Cyrillic names

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
lisabon
Junior Member
Junior Member
Posts: 34
Joined: 2014-11-22, 12:57 UTC

[9.20rc3] wfx-plugins not available with Cyrillic names

Post by *lisabon »

Hello!
I found a bug.

Here are the conditions for identifying bug:

1-st. I installed Total Commander 9.20 release candidate 3.
2-nd. I changed the encoding of the file wincmd.ini (Link for my wincmd.ini-file: https://www.upload.ee/files/8623600/wincmd.ini.html ), from ANSI to UTF16-Le Bom.
3-rd. I installed the wfx-plugins and then changed the names of the wfx-plugins from Latin to Cyrillic, for example:

Code: Select all

[FileSystemPlugins]
SFTP=%COMMANDER_PATH%\Plugins\wfx\SFTP\SFTPPlug.wfx
WebDAV=%COMMANDER_PATH%\Plugins\wfx\WebDAV\DAVPlug.wfx
Виртуальный диск=%COMMANDER_PATH%\Plugins\wfx\VirtualDisk\VirtualDisk.wfx
Диспетчер автозагрузки=%COMMANDER_PATH%\Plugins\wfx\Startups\Startups.wfx
Диспетчер задач=%COMMANDER_PATH%\Plugins\wfx\AceHelper\AceHelper.wfx
Доступ к облачному сервису @Mail.Ru=%COMMANDER_PATH%\Plugins\wfx\CloudMailRu\MailRuCloud.wfx
Доступ к облачным сервисам Box, Dropbox, Google Drive, OneDrive, Yandex.Disk=%COMMANDER_PATH%\Plugins\wfx\Cloud\CloudPlugin.wfx
Доступ к файловым системам Ext2/3/4, ReiserFS, HFS/HFS+, NTFS, Fat/exFAT, UFS2=%COMMANDER_PATH%\Plugins\wfx\DiskInternals_Reader\DiskInternals_Reader.wfx
Локальные службы=%COMMANDER_PATH%\Plugins\wfx\Services2\Services2.wfx
Переменные среды=%COMMANDER_PATH%\Plugins\wfx\EnvVars\EnvVars.wfx
Просмотр событий=%COMMANDER_PATH%\Plugins\wfx\SystemEventsEx\SystemEventsEx.wfx
Редактор реестра=%COMMANDER_PATH%\Plugins\wfx\Registry\Registry.wfx
Телефонная книга=%COMMANDER_PATH%\Plugins\wfx\tcPhonebook\tcPhonebook.wfx
Удаление программ=%COMMANDER_PATH%\Plugins\wfx\UnInstaller64\Uninstaller64.wfx
Файловые потоки NTFS=%COMMANDER_PATH%\Plugins\wfx\wfx_FileStreams\wfx_FileStreams.wfx
4-th. I installed the system locale in English:
Image: https://www.upload.ee/image/8623513/1.png
5-th I launch the Total Commander and switch to the "Network Neighborhood" to use the wfx-plugins.
6-th As a result, plugins are not available, whose names contain Cyrillic. Only plugins are available, the names of which contain the Latin.
Image: https://www.upload.ee/image/8623582/2.png

It should be like this:
Image: https://www.upload.ee/image/8623590/3.png

I checked this bag on different operating systems from windows xp to windows 10. The bug reproduced everywhere.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This isn't really a bug, just a missing feature. When you try to rename a plugin entry now, you will get an error when entering a Unicode name.

I added a similar feature for saved searches recently:
28.05.18 Added: Support Unicode in names of saved searches when the wincmd.ini (or the redirected ini for [searches] section) is stored with Unicode UTF-16 (32/64)

Unfortunately, TC 9.20 is already feature-complete, therefore I will not change it at this time. I will add it to my wish list for a later version.
Author of Total Commander
https://www.ghisler.com
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Post by *Usher »

ghisler(Author) wrote: I added a similar feature for saved searches recently:
28.05.18 Added: Support Unicode in names of saved searches when the wincmd.ini (or the redirected ini for [searches] section) is stored with Unicode UTF-16 (32/64)
IMHO it's done in a wrong way. I think you should not extend ini syntax, as the file may be broken when open in some programmer editors.

Most programs recognize and use the simpliest ini syntax llike that

Code: Select all

[SectionName1]
name1=value1
name2=value2

[SectionName2]
name3=value3
name4=value4
name5=value5
where names may be only numeric or alphanumeric strings containing US-ASCII characters with NO spaces or special characters allowed.

Some editors may expect only the simpliest syntax and may remove or convert disallowed characters when saving changes.
It is better to keep traditional syntax and use internationalized names as values in a separate line, f.e.

Code: Select all

TaskManager=%COMMANDER_PATH%\PLUGINS\wfx\proc\PROCFS.wfx
TaskManager_Name="Menedżer zadań"
Note that you have already introduced another incompatible change in TC920b5:
history.txt wrote:27.05.18 Added: When going to the root of a drive or share, e.g. via
Ctrl+< or "" button, place cursor on the directory which was part of the path, e.g.
go to root from c:\Windows\System32 -> put cursor on "Windows" (32/64)
After this change there are Tab characters existing in wincmd.ini. In many cases programmer editors unfold tabs to spaces by default or users change editor settings to do so for all edited file types. That way in many cases TC ini files may be broken after any use of "Change Setting Files Directly" option.
If you want to keep tabs, you should use "\t" rather than real tab character - as it's done in language files.
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:

Post by *ghisler(Author) »

IMHO it's done in a wrong way. I think you should not extend ini syntax
I'm not extending the ini syntax in this case: Unicode names in search names are only supported when the ini file is stored as UTF-16 Unicode.
Author of Total Commander
https://www.ghisler.com
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Post by *Usher »

Unicode or ANSI - it doesn't matter. You cannot expect that all external editors will be as liberal as you think and you have no possibility to force needed behaviour, I'm afraid.
IMHO, if you allow to use external editors for TC ini files, you should better stay with traditional ini syntax. That way you will limit number of possible points of failure. Less problems reported, less bug reports, less debugging and explaining, more time to think about suggested features ;-)
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:

Post by *ghisler(Author) »

You cannot prevent external editors.
Author of Total Commander
https://www.ghisler.com
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

2Usher
An editor doesn't need to be "liberal", it just needs to understand Unicode, because wincmd.ini is nothing but a plain text file. Even the case-study of an editor included with Windows - commonly called Notepad - understands Unicode. No editor needs to understand any INI syntax to be able to edit wincmd.ini correctly, just ANSI and Unicode.

So I don't see any problem with the "extended ini syntax" as you call it, because that doesn't matter.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Post by *Usher »

It's not about Unicode, it's about syntax, and traditional ini syntax allows only characters from US-ASCII character set in names (identifiers), no matter what encoding is used for ini files.
Look at the example for C++: can you use anything like the code below?

Code: Select all

żółw := wąż++
Notepad is a simple text editor, unaware of syntax used in programming (and also unaware, that UTF-8 by default doesn't use BOM), and I'm talking about programmer editors which can parse syntax and colour displayed text depending on file type. TC is a tool for advanced users so you should expect that they use more advanced editors rather than just Notepad.

On the other hand - TC is a tool available also for older Windows versions and you cannot expect that users have installed the latest versions of their favourite editors.

As @ghisler(Author) wrote - You cannot prevent external editors.

So you cannot also know how they understand ini syntax and how they may interpret unknown syntax constructions.
As Murphy said "whatever can go wrong, will go wrong", and sooner or later you will understand that "Murphy was an optimist", I'm afraid.
Andrzej P. Wozniak
Polish subforum moderator
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

Usher wrote:[...] and traditional ini syntax allows only characters from US-ASCII character set in names (identifiers), no matter what encoding is used for ini files.
Says who? I've been using ANSI strings in my file-system plugins for many years now, and didn't have any problems with it. E.g.

Code: Select all

[FileSystemPlugins]
Geräte-Manager=%COMMANDER_PATH%\Plugins\DevMan\devman.wfx
works just fine.
Look at the example for C++: can you use anything like the code below?

Code: Select all

żółw := wąż++
What does have C++ - or any other programming language, for that matter - to do with it? It depends on the compiler if it supports ANSI or even Unicode variable names. IIRC newer Delphi versions allow to use them.
[...] and I'm talking about programmer editors which can parse syntax and colour displayed text depending on file type.
So where exactly do you see a problem with these editors? They color the file parts based on its syntax, but the syntax stays the same, regardless of the encoding of the key names or the file itself. It's still

Code: Select all

[section]
key=value
Even if there would be a problem with the coloring in some editor (which is what I don't think is going to happen), there's almost always an option to disable it, and edit wincmd.ini as regular plain text file.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
VSB
Member
Member
Posts: 136
Joined: 2006-12-12, 12:02 UTC
Location: Russia

Post by *VSB »

2Usher
Can you show RFC or IEEE for INI files? Requirement for TC (and other software) to use it (if it exists)?


A lot of software and libraries have they own flavor of INI.
If you dont like this situation, you can ask Christian to move settings store to XML format - with true Unicode and app-specific scheme, but it will break all plugin managers, advanced config editors, and may be source for bunch of bugs, so I suppose, Christian don't want to do that.

However, iI think some kind of this may be usefull because currently he use some kludges like plugin_detect and '|'-separated values to circumvent ini format restrictions (mostly, only one nesting level). Sometimes it's unclear or hard to maintain.
Post Reply