Problem with WCX plugin and source file names in Chinese
Moderators: Hacker, petermad, Stefan2, white
Problem with WCX plugin and source file names in Chinese
Hi
I am playing with TotalCommander and learning how to write a wcx plugin for it. I just noticed a problem with a wcx plugin.
The plugin I am writing is for packing files only (no unpacking). So I defined the capability of the plugin as
PK_CAPS_NEW|PK_CAPS_MODIFY|PK_CAPS_OPTIONS
If I choose a source file whose name ends with Chinese words, then press "Alt+F5" to use the plugin. The destination file name provided by TC contains corrupted characters.
But if I defined the plugin's capbility as
PK_CAPS_NEW|PK_CAPS_MODIFY|PK_CAPS_MULTIPLE|PK_CAPS_OPTIONS
There was no probelm. Is this a defined behavior?
In addition, I guess TC has to calculate total size of the selected files before calling wcx plugins, in order to display the progress window correctly. If the calculation is done before calling the plugin's PackFiles method, is it possible to pass the total size to the plugin? This may be useful if the plugin need call thirty command and operates on directory instead of files.
Thanks!
I am playing with TotalCommander and learning how to write a wcx plugin for it. I just noticed a problem with a wcx plugin.
The plugin I am writing is for packing files only (no unpacking). So I defined the capability of the plugin as
PK_CAPS_NEW|PK_CAPS_MODIFY|PK_CAPS_OPTIONS
If I choose a source file whose name ends with Chinese words, then press "Alt+F5" to use the plugin. The destination file name provided by TC contains corrupted characters.
But if I defined the plugin's capbility as
PK_CAPS_NEW|PK_CAPS_MODIFY|PK_CAPS_MULTIPLE|PK_CAPS_OPTIONS
There was no probelm. Is this a defined behavior?
In addition, I guess TC has to calculate total size of the selected files before calling wcx plugins, in order to display the progress window correctly. If the calculation is done before calling the plugin's PackFiles method, is it possible to pass the total size to the plugin? This may be useful if the plugin need call thirty command and operates on directory instead of files.
Thanks!
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
When PK_CAPS_MULTIPLE is missing, TC is changing the target name to e.g. *.*.ext for packing to multiple separate archives. Apparently this doesn't work with Chinese names.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Thanks for the reply! I did not notice this forum and I posted my questions in a wrong one, and kept check ing for any response there. Sorry.
Supprisingly, if PK_CAPS_MULTIPLE is missing, and I choose to pack multiple separate archives, this does work with Chinese names. In this case, I use the same name of the source AddList as the target name for each selected source directories.
The problem happens when I only selected one file to use the plugin. The target name suggested by TC contains corrupted characters. Actually, it is not that corrupted. Only ".ext" becomes "?ext", the "dot" becomes "?" in the suggested target file name.
This problem does not occur If I add PK_CAPS_MULTIPLE.
Supprisingly, if PK_CAPS_MULTIPLE is missing, and I choose to pack multiple separate archives, this does work with Chinese names. In this case, I use the same name of the source AddList as the target name for each selected source directories.
The problem happens when I only selected one file to use the plugin. The target name suggested by TC contains corrupted characters. Actually, it is not that corrupted. Only ".ext" becomes "?ext", the "dot" becomes "?" in the suggested target file name.
This problem does not occur If I add PK_CAPS_MULTIPLE.
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Does this happen with all Chinese names, or only some? Anyway, I will try to reproduce it (Win2k can be switched to Chinese), and then try to find a workaround.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
I have just tried to reproduce it here, both with a Chinese file name and English extension, and with Chinese name+extension - no problems! Maybe it happens only with certain characters?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Thanks for taking care of this problem.
Firstly, I am sorry that I might have given you wrong information. My plugin operates on directories not files. So the problem is actually with directory names but not file names.
So the problem is if I select a directory whose name's last characters is Chinese (I guess the same problem may happen with Japanese and Korean languages as well), then press "Alt+F5" to use my plugin to pack the selected directory, the target file's name offered by TC for the plugin would contain corrucpted characters.
The problem will be gone if the plugin can do PK_CAPS_MULTIPLE.
I have tested quite throughly and asked my friends to test as well. The problem is quite repeatable. I even don't have to recompile the code, change the configure of the plugin in the wincmd.ini from
to
will show the problem.
Please refer to my email to you a few days back regarding how to submit plugins to your addons page. If allowed, I would like to submit the plugin, or if you think ok, I can send the plugin to you via email to test.
Firstly, I am sorry that I might have given you wrong information. My plugin operates on directories not files. So the problem is actually with directory names but not file names.
So the problem is if I select a directory whose name's last characters is Chinese (I guess the same problem may happen with Japanese and Korean languages as well), then press "Alt+F5" to use my plugin to pack the selected directory, the target file's name offered by TC for the plugin would contain corrucpted characters.
The problem will be gone if the plugin can do PK_CAPS_MULTIPLE.
I have tested quite throughly and asked my friends to test as well. The problem is quite repeatable. I even don't have to recompile the code, change the configure of the plugin in the wincmd.ini from
Code: Select all
tio=23,F:\totalcmd\plugins\totaliso\TotalISO.wcx
Code: Select all
tio=19,F:\totalcmd\plugins\totaliso\TotalISO.wcx
Please refer to my email to you a few days back regarding how to submit plugins to your addons page. If allowed, I would like to submit the plugin, or if you think ok, I can send the plugin to you via email to test.
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Yes, please send me the plugin by e-mail for testing!
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Thanks, I could reproduce and correct the name error.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com