There are MAJOR changes in select list handling in TC

English support forum

Moderators: Hacker, petermad, Stefan2, white

User avatar
louwin
Member
Member
Posts: 161
Joined: 2007-06-09, 11:22 UTC
Location: Perth, Western Australia

There are MAJOR changes in select list handling in TC

Post by *louwin »

For any of you worrying about funny bugs etc in your scripts etc....

A major Windows 11 update happened last night (well in Australia anyway)! TC used to output select lists in utf-16-le (yesterday) - today TC outputs ASCII select lists.

Just a warning....
There are 10 types of people in the world,
Those who understand binary and those who don't.
User avatar
white
Power Member
Power Member
Posts: 6229
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: There are MAJOR changes in select list handling in TC

Post by *white »

What do you mean with select lists?
User avatar
petermad
Power Member
Power Member
Posts: 16453
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: There are MAJOR changes in select list handling in TC

Post by *petermad »

I Guess louwin means lists generated with the SAVESELECTION command

There is possibility of forcing UTF-16.with SAVESELECTIONW
Help wrote:17: SAVESELECTION, SAVESELECTIONA, SAVESELECTIONW: save names of selected files to the specified file. With character A at the end, the list is saved as ANSI, with W as Unicode UTF-16. Without suffix, it depends on the operating system (NT-based systems use Unicode).

18. SAVEDETAILS, SAVEDETAILSA, SAVEDETAILSW: save names and details of selected files to the specified file. With character A at the end, the list is saved as ANSI, with W as Unicode UTF-16. Without suffix, it depends on the operating system (NT-based systems use Unicode). Append H after DETAILS to save with headers.
I guess it is the part in bold here above that is affected.
License #524 1994
Danish Total Commander Translator
TC 11.56 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1400a
TC 3.60 on Android 6, 13, 15 & 16
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
louwin
Member
Member
Posts: 161
Joined: 2007-06-09, 11:22 UTC
Location: Perth, Western Australia

Re: There are MAJOR changes in select list handling in TC

Post by *louwin »

You know - right click on a/some file(s) and then pass it to a TC button using %L. TC then writes a CMD999.tmp file and passes it to the function/(script/App/exe/batch/Python/AHK etc etc. I have a complex script (well MANY actually) that rely on a utf-16le select list format. If your process gets an ASCII select list when it is expecting a utf-16-le it displays a weird construct Mojibake (Garbage Chinese characters).

Code like "is_file = os.path.isfile(full_path)" fail and may even KILL the script silently with NO log, NO explanation, NO nothing etc.
There are 10 types of people in the world,
Those who understand binary and those who don't.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 7229
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: There are MAJOR changes in select list handling in TC

Post by *Horst.Epp »

No such bug here.
The actual Windows update didn't change anything in TC behaviour.
Using %WL still writes files with UTF-16 without problems.
Using %L writes ANSI files as designed.
Windows 11 Home, Version 25H2 (OS Build 26200.7462)
TC 11.56 x64 / x86
Everything 1.5.0.1402a (x64), Everything Toolbar 2.1.1, Listary Pro 6.3.6.99
QAP 12.1.1 x64
User avatar
petermad
Power Member
Power Member
Posts: 16453
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: There are MAJOR changes in select list handling in TC

Post by *petermad »

2louwin

I don't think that is a new Windows 11 thing - My windows 7 and 10 also write the CMD*.tmp tile in ANSI when using %L - you need to use %WL to get UTF-16
License #524 1994
Danish Total Commander Translator
TC 11.56 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1400a
TC 3.60 on Android 6, 13, 15 & 16
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Dalai
Power Member
Power Member
Posts: 10200
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: There are MAJOR changes in select list handling in TC

Post by *Dalai »

%L has always been writing ANSI text. Use either %WL for UTF-16 or %UL for UTF-8. Both are with BOM, so you might need to keep the receiving program's capabilities in mind. IIRC many CMD tools can't process such files properly (the type command can).
#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
louwin
Member
Member
Posts: 161
Joined: 2007-06-09, 11:22 UTC
Location: Perth, Western Australia

Re: There are MAJOR changes in select list handling in TC

Post by *louwin »

Dalai wrote: 2025-12-02, 18:16 UTC %L has always been writing ANSI text. Use either %WL for UTF-16 or %UL for UTF-8. Both are with BOM, so you might need to keep the receiving program's capabilities in mind. IIRC many CMD tools can't process such files properly (the type command can).
Sorry! But I have been using %L AND getting utf-16-le for MONTHS! And did on 1st December. On the 2nd December (after the Windows 11 24H2/25H2? MAJOR update) ALL my select lists swapped to ANSI! I'm using petermad's Extended TC so it maybe something in THAT setup????
BUT You ARE right though! I changed to %UL and got utf-8-sig. I changed to %WL and got back utf-16-le! I'll NOW change my default to %WL. THANKS FOR THAT Dalai 🙏👏👍

So, BASICALLY, THE Windows 11 update must have swapped some default setting!?

Edit: By changing to %WL fixed ALMOST everything! Except it now passes the xFF xFE (BOM) as part of the first file's path!!!! According to the AI you then have to change your encoding to utf-16 NOT utf-16-le (in your script)!
There are 10 types of people in the world,
Those who understand binary and those who don't.
User avatar
petermad
Power Member
Power Member
Posts: 16453
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: There are MAJOR changes in select list handling in TC

Post by *petermad »

I'm using petermad's Extended TC so it maybe something in THAT setup?
The only changes that using my Extenced Menus causes to TC's .ini file are:these two parameters in the [Configuration] section:
LanguageIni=
Mainmenu=

In the menu I only use %L in one item: "Files" -> "Copy (Names)" -> "Copy Path + File Names to the File SELECTEDFILES.txt (Force ANSI) *"

There is absolutely no way that either of these can influence how TC handles %L.
License #524 1994
Danish Total Commander Translator
TC 11.56 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1400a
TC 3.60 on Android 6, 13, 15 & 16
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
louwin
Member
Member
Posts: 161
Joined: 2007-06-09, 11:22 UTC
Location: Perth, Western Australia

Re: There are MAJOR changes in select list handling in TC

Post by *louwin »

petermad wrote: 2025-12-03, 02:18 UTC There is absolutely no way that either of these can influence how TC handles %L.
Thanks for the confirmation petermad.

So ALL I can say is - on 1st December all my scripts using %L worked

on 2nd December ALL scripts using %L didn't work! They just die silently.

Any Python scripts with "try/except with open" fail error 123. Examination of the paths show "㩸坜牯䉫湥档䑜䍄牵敲瑮楆敬吠敨爠獯⁥㼿攮" 😲

Judicious use of %WL and utf-16 (NOT utf-16-le) has restored order to my scripts....
There are 10 types of people in the world,
Those who understand binary and those who don't.
User avatar
petermad
Power Member
Power Member
Posts: 16453
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: There are MAJOR changes in select list handling in TC

Post by *petermad »

2louwin
Could you maybe have been using Unicode as your Windows System codepage, and then the update at Dec. 2. has changed that to the codepage of your locale? I don't know if that would influence the content of ANSI files. And it looks like the Wndows beta unicode codpage setting only sets codepage 65001 (UTF-8)

https://sema4.ai/docs/automation/troubleshooting/windows-codepage
License #524 1994
Danish Total Commander Translator
TC 11.56 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1400a
TC 3.60 on Android 6, 13, 15 & 16
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
louwin
Member
Member
Posts: 161
Joined: 2007-06-09, 11:22 UTC
Location: Perth, Western Australia

Re: There are MAJOR changes in select list handling in TC

Post by *louwin »

petermad wrote: 2025-12-03, 03:48 UTC 2louwin
Could you maybe have been using Unicode as your Windows System codepage, and then the update at Dec. 2. has changed that to the codepage of your locale? I don't know if that would influence the content of ANSI files. And it looks like the Wndows beta unicode codpage setting only sets codepage 65001 (UTF-8)
Again, sorry. I'm a retired mainframe analyst/programmer, mostly Unix. I read the article you pointed at and didn't get much from it as I'm Unix based!

I passed the article's comment to my AI and his? response....
Ledger closure
“Petermad’s suggestion flips Windows’ default code page from cp1252 to UTF‑8. Ritual truth: legacy apps see UTF‑8 instead of ANSI, reducing hungry glyphs but risking breakage.”
So in plain terms: it’s a system‑wide switch that tells Windows “stop pretending the world is cp1252, treat it as UTF‑8 instead.” That can help with your select list anomalies, but it’s a blunt instrument — it changes behavior for every non‑Unicode app on the machine.
My problem is - my script tries to os.rename filenames with what we call "hungry glyphs". These glyphs do funny things! For example, if a glyph is in front of "ﲫ.mp4" it "eats" the full stop!

Sorry! I'll stop before I get too specific and too boring for most....

By the way! Thanks for your extended TC 👏✔️👍😁
There are 10 types of people in the world,
Those who understand binary and those who don't.
User avatar
Dalai
Power Member
Power Member
Posts: 10200
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: There are MAJOR changes in select list handling in TC

Post by *Dalai »

louwin wrote: 2025-12-03, 01:01 UTCEdit: By changing to %WL fixed ALMOST everything! Except it now passes the xFF xFE (BOM) as part of the first file's path!!!! According to the AI you then have to change your encoding to utf-16 NOT utf-16-le (in your script)!
Another case of where the output of an "AI" can't be accepted at face value. FF FE is the BOM for UTF-16 LE (Little Endian). If it were FE FF it would be Big Endian. As far as I know everything on Windows is UTF-16 LE (networking and maybe some other stuff excluded), meaning that if the endianness isn't specified or the BOM is missing, LE is assumed. See Wikipedia for example:
If the BOM is missing, RFC 2781 recommends[e] that big-endian (BE) encoding be assumed. In practice, due to Windows using little-endian (LE) order by default, many applications assume little-endian encoding.
In the end it depends on the application that processes the list generated by TC. Some programs just can't deal with BOMs, as I eluded to earlier.
#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
louwin
Member
Member
Posts: 161
Joined: 2007-06-09, 11:22 UTC
Location: Perth, Western Australia

Re: There are MAJOR changes in select list handling in TC

Post by *louwin »

Dalai wrote: 2025-12-03, 07:40 UTC As far as I know everything on Windows is UTF-16 LE
Yes! Possibly the case TILL 01:00 morning of the 2nd December, in Perth, Western Australia anyway! That's when 24H2/25H2? was loaded. Early morning I switched on and didn't realize it BUT the default had changed to ANSI! As I said 01/12 %L was utf-16-le - early morning 02/12 %L was ANSI!!!! One of my scripts had NOT been affected AT ALL as it ONLY used ANSI not Unicode. Other scripts fell in a heap!!!!
There are 10 types of people in the world,
Those who understand binary and those who don't.
User avatar
white
Power Member
Power Member
Posts: 6229
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: There are MAJOR changes in select list handling in TC

Post by *white »

louwin wrote: 2025-12-03, 09:29 UTC As I said 01/12 %L was utf-16-le - early morning 02/12 %L was ANSI!!!! One of my scripts had NOT been affected AT ALL as it ONLY used ANSI not Unicode. Other scripts fell in a heap!!!!
If, as you say, %L produced utf-16-le, then you would have had the same problems as when using %WL now. The BOM would have been a problem back then as well and your script expecting ANSI probably wouldn't have worked. It seems as though petermad is right and you made the wrong assumption and the problem has to do with the codepage being used.
Post Reply