Why does TC create lists of files (%L %UL) always with BOM?
Moderators: Hacker, petermad, Stefan2, white
Why does TC create lists of files (%L %UL) always with BOM?
Hi
Why does TC create lists of files (%L %UL) always with BOM?
Why does TC create lists of files (%L %UL) always with BOM?
Re: Why does TC create lists of files (%L %UL) always with BOM?
The detection of character sets in different formats is easier with BOM.
I never had problems with this, in a lot of file managers, editors and other tools.
What's your specific problem with it ?
I never had problems with this, in a lot of file managers, editors and other tools.
What's your specific problem with it ?
Windows 11 Home, Version 24H2 (OS Build 26100.4061)
TC 11.55 RC2 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.4 x64
TC 11.55 RC2 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.4 x64
Re: Why does TC create lists of files (%L %UL) always with BOM?
%L shouldn't add a BOM because it saves the list file as ANSI (without a BOM as far as I know). I suppose you mean %UL and %WL.
If a BOM exists, there is no doubt on how to interpret the following data. If there is no BOM certain characters can be ambiguous because they're valid in UTF-8 and ANSI simultaneously for example. BTW, it's documented in TC's help that %UL and %WL save the list with a BOM.
Regards
Dalai
If a BOM exists, there is no doubt on how to interpret the following data. If there is no BOM certain characters can be ambiguous because they're valid in UTF-8 and ANSI simultaneously for example. BTW, it's documented in TC's help that %UL and %WL save the list with a BOM.
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
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: Why does TC create lists of files (%L %UL) always with BOM?
How to correctly read %UL list from BOM in windows batch?
I need to read the first line from the %UL list without BOM.
I need to read the first line from the %UL list without BOM.
- ghisler(Author)
- Site Admin
- Posts: 50532
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Why does TC create lists of files (%L %UL) always with BOM?
Just cut off the first character, e.g. something like %var:~1%
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Why does TC create lists of files (%L %UL) always with BOM?
Windows batch in console do not handle Unicode correctly. You can anyhow handle some input/output in UTF-8 changing codpage to 65001.
To print, you must change console font to lucida console or one with all the char you plan to print.
UTF-16 is not supported at all even with codepage !
If you want to use utf-16, do not use batch. You can use powershell with Unicode encoding.
To print, you must change console font to lucida console or one with all the char you plan to print.
UTF-16 is not supported at all even with codepage !
If you want to use utf-16, do not use batch. You can use powershell with Unicode encoding.
Re: Why does TC create lists of files (%L %UL) always with BOM?
This was actually discussed in the past several times.
I even made a suggestion to include BOM-less UTF-8 list files, years ago
viewtopic.php?t=48032
Not implemented so far, from what I can see.
:
You can type a UTF-16 list file (for loops) w/o problems in batch/cmd:
viewtopic.php?t=48032&p=335753
I even made a suggestion to include BOM-less UTF-8 list files, years ago
viewtopic.php?t=48032
Not implemented so far, from what I can see.
Just a small remindernsp wrote: 2023-06-28, 14:53 UTC Windows batch in console do not handle Unicode correctly. You can anyhow handle some input/output in UTF-8 changing codpage to 65001.
To print, you must change console font to lucida console or one with all the char you plan to print.
UTF-16 is not supported at all even with codepage !
If you want to use utf-16, do not use batch. You can use powershell with Unicode encoding.

You can type a UTF-16 list file (for loops) w/o problems in batch/cmd:
viewtopic.php?t=48032&p=335753
TC plugins: PCREsearch and RegXtract
Re: Why does TC create lists of files (%L %UL) always with BOM?
On this thread, the only working cases are using UTF-8.milo1012 wrote: 2023-06-28, 20:53 UTC Just a small reminder:
You can type a UTF-16 list file (for loops) w/o problems in batch/cmd:
viewtopic.php?t=48032&p=335753
Just give a try with cmd /U with an utf-16LE file i.e test.lst
cmd /U only produce UTF-16LE output !
do a loop like
Code: Select all
for /F "usebackq tokens=* delims=" %n in ( test.lst ) do notepad "%n"