Ini files in wrong directory (because of Polish letter?)

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Mooschka
Junior Member
Junior Member
Posts: 6
Joined: 2020-02-26, 06:42 UTC

Ini files in wrong directory (because of Polish letter?)

Post by *Mooschka »

I experienced problem with recognizing user profile directory by Total Commander 9.50. Didn't check earlier version - fresh installation. Windows 10 Pro EN-US), local user name Paweł (with Polish letter ł at the end). During installation, user profile is recognized as Pawel, with l at the end.
After installation, program is unable to write to config files, located in wrong directory. when I will start with admin rights new folder Pawel in C:\Users directory is created.
I tried with English and Polish language in tcmdr, the same.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Ini files in wrong directory (because of Polish letter?)

Post by *ghisler(Author) »

This only works when setting the user locale to Poland for non-Unicode programs. Otherwise the ł isn't part of the codepage and cannot be used in ANSI INI file functions. This cannot be fixed on my side.
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

Re: Ini files in wrong directory (because of Polish letter?)

Post by *MVV »

ghisler(Author),
I think TC should only use Unicode API for any file operations, including accessing INI files. You can always convert Unicode string to an ANSI one after reading if needed.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Ini files in wrong directory (because of Polish letter?)

Post by *ghisler(Author) »

The problem is that bad things happen when you access an ANSI INI file with Unicode API. One solution would be to convert the INI file to Unicode when it is found in a Unicode-only folder. This would lose compatibility with Windows 9x/ME.
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

Re: Ini files in wrong directory (because of Polish letter?)

Post by *MVV »

Shouldn't GetPrivateProfileStringW+WideCharToMultiByte(CP_ACP) produce the same output as GetPrivateProfileStringA? What kind of bad things may happen?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Ini files in wrong directory (because of Polish letter?)

Post by *ghisler(Author) »

I have no enabled the option myself, and I had no problems reading the INI file even from a direcory with Polish characters. However, I didn't create a profile with Polish letters yet - I just set the ini location with various methods:
1. Started Total commander with parameter /i=c:\test\äöüł\wincmd.ini
2. In registry key HKEY_CURRENT_USER\Software\Ghisler\Total Commander set the value
iniFileName to c:\test\äöüł\wincmd.ini
3. In registry key HKEY_CURRENT_USER\Software\Ghisler\Total Commander set the value
iniFileName to %tcdirectory%wincmd.ini
and set environment variable
%tcdirectory% to c:\test\äöüł\

I tried with both ANSI and Unicode wincmd.ini, it both worked fine!

Could you please check how the location of your wincmd.ini is defined?
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: Ini files in wrong directory (because of Polish letter?)

Post by *Usher »

2Mooschka
Have you installed Polish language pack for Windows?
Andrzej P. Wozniak
Polish subforum moderator
Mooschka
Junior Member
Junior Member
Posts: 6
Joined: 2020-02-26, 06:42 UTC

Re: Ini files in wrong directory (because of Polish letter?)

Post by *Mooschka »

Usher wrote: 2020-02-28, 15:54 UTC 2Mooschka
Have you installed Polish language pack for Windows?
No, I don't have.
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Ini files in wrong directory (because of Polish letter?)

Post by *Usher »

So do it…
Andrzej P. Wozniak
Polish subforum moderator
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Ini files in wrong directory (because of Polish letter?)

Post by *ghisler(Author) »

I don't have any Polish language pack installed, and it works just fine! So apparently something is configured wrong on Mooschka's PC.

2Mooschka
Could you please do the following:
1. Run regedit.exe
2. Go to HKEY_CURRENT_USER\Software\Ghisler\Total Commander
3. Let me know the value of "iniFileName" in the right panel (just copy and paste it here)

If the value contains a text between percent signs like %APPDATA%, do the following:
4. From menu "Commands", choose "Open command prompt window"
5. Type the following command and press ENTER:
echo %APPDATA%
Note: Please replace the text between percent signs with the one from step 3 above if it is different. %APPDATA% is the most used.
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Ini files in wrong directory (because of Polish letter?)

Post by *ghisler(Author) »

2Mooschka
Could you please answer my questions? I'm "hanging in the air" without additional information. :(
Author of Total Commander
https://www.ghisler.com
Mooschka
Junior Member
Junior Member
Posts: 6
Joined: 2020-02-26, 06:42 UTC

Re: Ini files in wrong directory (because of Polish letter?)

Post by *Mooschka »

Hi! Sorry for delay. Finally I have installed Windows with adding Microsoft account and the local name is pawel now, so problem disappeared.

I have added new local account Paweł again and I tried to download and install Total Commander. After downloading and start setup I have a got an error: The setup information file was not found!
Screenshot: Image: https://i.imgur.com/krMjLhl.png

After moving install file to other folder installation has started as usual. Fe days ago I have installed from NAS drive.

Registry after installation:
[HKEY_LOCAL_MACHINE\SOFTWARE\Ghisler\Total Commander]
"IniFileName"="%APPDATA%\\GHISLER\\wincmd.ini"
"FtpIniName"="%APPDATA%\\GHISLER\\wcx_ftp.ini"
"InstallDir"="C:\\totalcmd"

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Ghisler\Total Commander]
"IniFileName"="%APPDATA%\\GHISLER\\wincmd.ini"
"FtpIniName"="%APPDATA%\\GHISLER\\wcx_ftp.ini"
"InstallDir"="C:\\totalcmd"
APPDATA value:
C:\Users\Paweł\AppData\Roaming
Mooschka
Junior Member
Junior Member
Posts: 6
Joined: 2020-02-26, 06:42 UTC

Re: Ini files in wrong directory (because of Polish letter?)

Post by *Mooschka »

Usher wrote: 2020-02-28, 16:59 UTCSo do it…
No, this is not a solution. I don't want PL lang pack.
Mooschka
Junior Member
Junior Member
Posts: 6
Joined: 2020-02-26, 06:42 UTC

Re: Ini files in wrong directory (because of Polish letter?)

Post by *Mooschka »

Other applications, like Notepad++, IrfanView or FileZilla, have created folders in AppData normally.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Ini files in wrong directory (because of Polish letter?)

Post by *ghisler(Author) »

So only the installer fails to run from a subdir of C:\Users\Paweł, but Total Commander then runs fine when the settings are under C:\Users\Paweł?
Author of Total Commander
https://www.ghisler.com
Post Reply