Page 1 of 1
Start menu - list file generation with accented chars
Posted: 2010-04-22, 16:02 UTC
by redihokuto
Hi,
I'm facing a problem with %L argument given to a batch file.
The file list is generated but accented characters are replaced by a different one inside the temporary file. I think the problem is unicode support? %UL or %WL does not produce any valid result.
The file with the scrambled characters can't be located.
Would be nice to have the list of selected files in the temporary file with correct characters...
I can't even imagine a system without total commander.
Thanks for all of your superb work!
Posted: 2010-04-22, 16:15 UTC
by ghisler(Author)
%L creates a list in plain text (ANSI) format. Unicode names will not work with it.
%UL produces a list in UTF-8 Unicode format (with byte order marker BOM). %WL creates a list in UTF-16 Unicode format (also with BOM). The called program needs to support Unicode to handle these list files.
Posted: 2010-04-23, 08:11 UTC
by redihokuto
Thanks for your quick answer!
I’m not familiar with all these chars codes…
Let me explain better my specific problem.
(1)
I have a filename with an “accented o” (ò): call it my_accented_o.
It is shown correctly in TC.
In cmd.exe a dir command produces correct result.
Redirection of dir command to a file: dir.out, then “type dir.out” produces correct result.
Open dir.out with TC lister: the char is 0x95. Shown correct in ‘S’ view (ASCII – dos), different in ‘A’ (ANSI) and different in ‘V’ view.
Anyway if the content of dir.out is used by a batch file my_accented_o is addressed correctly (found and accessible).
(2)
%L to produce a temporary file with my_accented_o file.
If I open the temporary file (list.tmp) with TC lister I found the “accented o” is coded as 0xF2 (instead of 0x95).
If I feed a batch file with list.tmp to make some operations over its items, my_accented_o file is not found in the file system…
A “type list.tmp” command doesn’t show the “accented o” properly.
(3)
With %S and saving all arguments in a file produces the same result as method (1): "accented o" coded as 0x95.
How I can get the “accented o” coded as 0x95 instead of 0xF2 inside the temporary list?
Why %L is not producing the same result as saving the list generated by %S?
I would like to use %L instead of %S to shorten the command line argument list.
Thanks.
Posted: 2010-04-23, 15:51 UTC
by ghisler(Author)
0xF2 is 242, so when I press Alt+0242 I get indeed an "ò". So this is the correct Windows ANSI code for it. I assume that 0x95 is the DOS ASCII code of the same character. %d will create a list with DOS names, but only in 8.3 format. Longer names will be converted to DOS format...