Internal Associations don't work with extensions containing control characters
Moderators: Hacker, petermad, Stefan2, white
Internal Associations don't work with extensions containing control characters
Internal association does not work (file type icon is not applied and associated program does not start) if extension name part has present a control character like left-to-right mark.
For example, on one of my read-only drives I have many files in PDF format with extension ".pdf" (the LRM character is between "f" and trailing quote mark). If in internal Asscociations I add such a new extension, change file type icon and set a program to open it, the association is created, but in TC I see blank white icon and after pressing Enter on file with such extension I see Windows dialog which asks to chosse the program which I want to use to open that file.
Furthermore, internal association which uses masks/wildcards, like *.pdf* or *.pdf? is not applied for such files either.
The character itself is not a problem for opening a file in desired program, e.g. if from TC's command line to launch:
d:\progra~1\sandbo~1\start.exe %HOMEDRIVE%progra~1\adobe\acroba~1.0\Acrobat\Acrobat.exe /a zoom=100 "file.pdf"
Adobe Acrobat opens the "file.pdf" file fine.
(off top: an example with Sanboxie is used because here launching Acrobat this way helps to avoid known Acrobat's "Fatal Error Acrobat failed to load its Core DLL", maybe someopne will find this info helpful).
For example, on one of my read-only drives I have many files in PDF format with extension ".pdf" (the LRM character is between "f" and trailing quote mark). If in internal Asscociations I add such a new extension, change file type icon and set a program to open it, the association is created, but in TC I see blank white icon and after pressing Enter on file with such extension I see Windows dialog which asks to chosse the program which I want to use to open that file.
Furthermore, internal association which uses masks/wildcards, like *.pdf* or *.pdf? is not applied for such files either.
The character itself is not a problem for opening a file in desired program, e.g. if from TC's command line to launch:
d:\progra~1\sandbo~1\start.exe %HOMEDRIVE%progra~1\adobe\acroba~1.0\Acrobat\Acrobat.exe /a zoom=100 "file.pdf"
Adobe Acrobat opens the "file.pdf" file fine.
(off top: an example with Sanboxie is used because here launching Acrobat this way helps to avoid known Acrobat's "Fatal Error Acrobat failed to load its Core DLL", maybe someopne will find this info helpful).
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Ukraine's National Bank special bank account:
UA843000010000000047330992708
- ghisler(Author)
- Site Admin
- Posts: 50383
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Internal Associations don't work with extensions containing control characters
Yes, files with LRM characters are filtered out on purpose because it is sometimes used by malware, e.g. to make a file named fdp.exe appear as .exe.pdf, to trick the user to open it.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Internal Associations don't work with extensions containing control characters
Where exactly should I put LRM char in the name fdp.exe so in Explorer it will look like exe.pdf? So far I cannot get this by putting LRM in the start, end of name, before or after the dot (tried on Windows 7 32 bit)...ghisler(Author) wrote: 2020-11-06, 14:25 UTCYes, files with LRM characters are filtered out on purpose because it is sometimes used by malware, e.g. to make a file named fdp.exe appear as .exe.pdf, to trick the user to open it.
Anyway, what is the point to filter control characters in Internal Associations, where users usually intentionally associate files with programs, so associated files aren't launched as executables?
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Ukraine's National Bank special bank account:
UA843000010000000047330992708
-
- Power Member
- Posts: 872
- Joined: 2013-09-04, 14:07 UTC
Re: Internal Associations don't work with extensions containing control characters
Nowhere. (I guess Christians comment was meant more about directional formatting characters in general, not specifically about LRM.)DrShark wrote: 2020-12-09, 10:21 UTC Where exactly should I put LRM char in the name fdp.exe so in Explorer it will look like exe.pdf?
Unless you are on a Hebrew, Arabic or other naturally right-to-left locale, your OS is already operating in LRM mode/level. Thus applying LRM will have no visible effect (as it attempts entering LRM mode/level that is already active for both your system in general and for latin letters/script)
Now, RLM (Right-to-Left-Mark; U+200F) would seem like the logical choice. Normally, when applying to a text block within a larger text, the RLM formatting char should be put at the right side of the text block being formatted right-to-left, like:
Code: Select all
fdp.exe[RLM]
Code: Select all
[RLM]fdp.exe

If RLM does not work, there are still explicit formatting characters such as RLO, LRO, RLI, LRI, PDI, etc. But i can't tell whether Explorer respects or ignores such formatting chars altogether, as i haven't tried it myself. Here their Unicode/UTF-16 byte codes:
Code: Select all
LRO U+202D (Left-to-Right-Override)
RLO U+202E (Right-to-Left-Override)
LRI U+2066 (Left-to-Right-Isolate)
RLI U+2067 (Right-to-Left-Isolate)
PDI U+2069 (Pop Directional Isolate)
Code: Select all
[RLO]fdp.exe
Code: Select all
[RLI]fdp.exe[PDI]
More details and further headache-inducing information can be found in the Unicode Bidirectional Algorithm spec at: http://unicode.org/reports/tr9/
Anyways, my apologies for the slight detour. Back to topic...

Re: Internal Associations don't work with extensions containing control characters
OK, this way the name looks like "exe.pdf" in Explorer's file listing and while file renaming, though the icon for "exe" extension is used and when rename field opens, the part of name without actual extension is autoselected.elgonzo wrote: 2020-12-09, 11:49 UTCHowever, since there is no text block embedded within a larger text here, perhaps try placing [RLM] at the beginning of the text instead:
Using RLO, try composing your file name like this:Code: Select all
[RLM]fdp.exe
Code: Select all
[RLO]fdp.exe
In TC, it depends on function which operates with the name and TC options, so, for example:
- in Shift+F6 inplace rename, F5/F6 copy/move dialogs, it looks like "exe.pdf";
- in file listing it depends on value of "Aligned extension" parameter from [Configuretion] section of wincmd.ini:
* with default
Code: Select all
[Configuration]
Aligned extension=1
* with default
Code: Select all
[Configuration]
Aligned extension=0
No matter how the name looks like, TC uses EXE file type icon for it (though different from one used for EXE in Explorer).
So if such character is supposed to be filtered out, I guess it should happen in file listing, so the name, when Aligned extension=1, should look the same way as when Aligned extension=0.
I still don't see any poing to filtering it out in Internal Associations.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Re: Internal Associations don't work with extensions containing control characters
It's possibile that there was no bug in TC and I messed up somewhere when configring the internal associations...
I just rechecked, and right now both wildcard method:
and direct *.pdf[LRM] associations work just fine in both TC 9.51 and 10.00:
I guess the topic can be moved to English forum...
I just rechecked, and right now both wildcard method:
Code: Select all
[Associations]
Filter1=*.pdf*
Filter1_open=d:\install\sandbo~1\start.exe %HOMEDRIVE%progra~1\adobe\acroba~1.0\Acrobat\Acrobat.exe /a zoom=100 "%1"
Filter1.icon=""%programfiles%\Adobe\Acrobat 11.0\Acrobat\AcroRd32.exe""
Code: Select all
[Associations]
Filter1=*.pdf‎
Filter1_open=d:\install\sandbo~1\start.exe %HOMEDRIVE%progra~1\adobe\acroba~1.0\Acrobat\Acrobat.exe /a zoom=100 "%1"
Filter1.icon=""%programfiles%\Adobe\Acrobat 11.0\Acrobat\AcroRd32.exe""
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Ukraine's National Bank special bank account:
UA843000010000000047330992708