Save all paths/filenames always as UTF-8 in wincmd.ini

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Save all paths/filenames always as UTF-8 in wincmd.ini

Post by *MarcinW »

Consider the following scenario (tested with WinXP):

1) we have a dir with polish letters in name - we can see this name in TCMD and Explorer as "Zdjęcia"
2) we have two subfolders inside: "test1" and "test2"
3) go to Control Panel -> Regional and Language Options -> Advanced tab -> Language for non-Unicode programs
4) select Polish - this will install additional language files from WinXP CD and will reboot computer
5) after reboot open TCMD, go to "Zdjęcia\test1", press Ctrl+D and add it to the hotlist
6) go to Control Panel and now select Arabic (Bahrain)
7) after reboot open TCMD, go to "Zdjęcia\test2", press Ctrl+D and add it to the hotlist

Now we can see in the wincmd.ini:

menu1=test1
cmd1=cd c:\Zdjęcia\test1
menu2=test2
cmd2=cd c:\Zdjęcia\test2

As we can see, the first menu is saved as ANSI, and the second as UTF-8 (I don't know the cause of this difference). This results in:

1) test1 menu works only when Polish language is set - it doesn't work when Arabic is set (TCMD can't go to "c:\Zdjęcia\test1" dir)

2) test2 works properly for Polish and also for Arabic.

Conclusion: it's better to get (from the operating system) all paths/filenames as Unicode and save them as UTF-8 - it works always, regardless of the regional settings. Paths saved as UTF-8 work even in Win9x systems.

Regards!

ADDED:

Same behavior is on the NTFS filesystem and the FAT16 filesystem. So a filesystem is not the cause of the difference in the encoding - the cause is the selected language.
Last edited by MarcinW on 2012-04-15, 14:01 UTC, edited 1 time in total.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Support adding such INI option, especially since TC already supports saving some paths in Unicode.
umbra
Power Member
Power Member
Posts: 876
Joined: 2012-01-14, 20:41 UTC

Post by *umbra »

I support it too. What a pity the whole wincmd.ini can't be saved as UTF-8.
Windows 10 Pro x64, Windows 11 Pro x64
User avatar
MaxX
Power Member
Power Member
Posts: 1189
Joined: 2012-03-23, 18:15 UTC
Location: UA

Post by *MaxX »

2MarcinW
Check your FS on C: and D:.
Looks like there's diffrent FS's (C is ntfs, D is fat32) and first of them works with unicode-paths better then second.

Some words about UTF8 "working" in win9x:
how do you imagine working of >128-th characters' of ANSI?
E.g., cyrillic letters (cp1251) or spec.symblos (cp.1252) on same bytes. UTF8 will NEVER work properly with upper then 128-th ANSI symbols! That's why "idea with utf8 in config" is bad decision for Win9x.
Ukrainian Total Commander Translator. Feedback and discuss.
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

MaxX wrote:Check your FS on C: and D:.
Looks like there's diffrent FS's (C is ntfs, D is fat32) and first of them works with unicode-paths better then second.
I haven't written anything about drive D:.
Both directories (test1 and test2) have been created on the same NTFS partition. However, I've tested also on a FAT16 partition with same results. As far as I remember, long filenames on FAT16 and FAT32 are always saved as Unicode.
MaxX wrote:Some words about UTF8 "working" in win9x:
how do you imagine working of >128-th characters' of ANSI?
E.g., cyrillic letters (cp1251) or spec.symblos (cp.1252) on same bytes. UTF8 will NEVER work properly with upper then 128-th ANSI symbols! That's why "idea with utf8 in config" is bad decision for Win9x.
I just wanted to say that I transferred the wincmd.ini file to the Win98 machine (with Polish language set) and tested. Both Ctrl+D menus: cmd1 and cmd2 work properly - TCMD can reach these directories when using Ctrl+D menu. So UTF-8 encoding in the wincmd.ini is not a problem on a Win98 machine.
User avatar
MaxX
Power Member
Power Member
Posts: 1189
Joined: 2012-03-23, 18:15 UTC
Location: UA

Post by *MaxX »

Now we can see in the wincmd.ini:
menu1=test1
cmd1=cd c:\Zdjęcia\test1
menu2=test2
cmd2=cd c:\Zdjęcia\test2
How did you get there symbols I marked?
I haven't written anything about drive D:.
Sorry, missed that one. Looks like I'm getting tired. :(
So UTF-8 encoding in the wincmd.ini is not a problem on a Win98 machine.
Strange, I've never seen that win9x can work with any type of unicode, including utf-8.
Ukrainian Total Commander Translator. Feedback and discuss.
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

MaxX wrote:
cmd2=cd c:\Zdjęcia\test2
How did you get there symbols I marked?
These symbols are saved in the wincmd.ini file - exactly as I pasted. This is so-called BOM (Byte Order Mark) - it is 0xef 0xbb 0xbf for UTF-8 (see http://en.wikipedia.org/wiki/Byte_order_mark).
Strange, I've never seen that win9x can work with any type of unicode, including utf-8.
Win9x has a very basic support for Unicode. You may install additional Unicode support - see "The Microsoft Layer for Unicode on Windows 95/98/ME Systems" (see http://msdn.microsoft.com/en-us/goglobal/bb688166).
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

BTW I just recollected that you can simply save your wincmd.ini in Unicode (UTF-16 LE) using e.g. Notepad - and TC will work with it normally. So no need in UTF-8 at all.
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

But can be UTF-16 ini file used by TCMD on Win9x systems...? Or easily edited with notepad on Win9x...? (I can't check it now).

Additional info: paths saved in UTF-8 (in wincmd.ini) work on a Win98 system even after uninstalling the "Microsoft Layer for Unicode on Windows 95/98/ME Systems".
User avatar
MaxX
Power Member
Power Member
Posts: 1189
Joined: 2012-03-23, 18:15 UTC
Location: UA

Post by *MaxX »

MarcinW wrote:But can be UTF-16 ini file used by TCMD on Win9x systems...? Or easily edited with notepad on Win9x...? (I can't check it now).
If can't -> you should use AkelPad or any other (normal!) editor, but never use default notepad (it is too weak to do anything normal).
Post Reply