Lister with default Explorer Preview mode may not recognise UTF-8 encoding

Bug reports will be moved here when the described bug has been fixed

Moderators: Hacker, Stefan2, white

Post Reply
Slavic
Senior Member
Senior Member
Posts: 264
Joined: 2006-02-26, 15:41 UTC
Location: Moscow, Russia

Lister with default Explorer Preview mode may not recognise UTF-8 encoding

Post by *Slavic »

When Lister cannot shown the file content using the Explorer Preview mode set by default, it returns to normal built-in modes. However, apparently the detection of text encoding is not performed as well as in default Autodetect mode.

How to reproduce
1. HISTORY.TXT is a good example for this test. Open it in Notepad and save in UTF-8 encoding, for example, as history8.txt. When viewed in Lister with Autodetect, it correctly chooses UTF-8 (as I guess, by 3 bytes of byte order mark added by Notepad).
2. Switch Lister to Explorer Preview mode: Configuration, Options, Edit/View, Configure internal viewer, Multimedia tab, Define view method by file type - input *.* and choose default view mode 8.
3. Use Lister for modified history8.txt: it shows the content in mode 8, as defined by default.
4. Rename the file to history8.dat. We used *.* mask, so the result is supposed to be the same. However, Lister switches to Text only mode (1) and you can see BOM mark at the begin.
5. Go to Multimedia tab and clear the checkbox on the left from "Define view method by file type". Lister shows history8.dat in UTF-8 mode (7).

Conclusion: fail to open content in Explorer Preview negatively affects the encoding detection.
Desktop: Windows 8.1 x64, Windows 11, TC 10.50 RC. Mobile: Pixel 5a, Android 12, TC 3.30
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 43212
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Lister with default Explorer Preview mode may not recognise UTF-8 encoding

Post by *ghisler(Author) »

Yes, in this case it switches to plain text view as a last resort. I will check whether I can add UTF-8 detertion.
Author of Total Commander
https://www.ghisler.com
Slavic
Senior Member
Senior Member
Posts: 264
Joined: 2006-02-26, 15:41 UTC
Location: Moscow, Russia

Re: Lister with default Explorer Preview mode may not recognise UTF-8 encoding

Post by *Slavic »

Fixed in TC 10 beta 7: UTF-8 text in the file with "non-supported" by Explorer handle extension like *.dat is shown correctly. Thanks!

It would be nice to detect HTML code the same way (for example, for server-side codes like *.js or *.php). Not exactly the same case, but very close. Reproduction: rename any *.htm to *.php, look in built-in Lister mode and compare with default Explorer Preview.
Desktop: Windows 8.1 x64, Windows 11, TC 10.50 RC. Mobile: Pixel 5a, Android 12, TC 3.30
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 43212
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Lister with default Explorer Preview mode may not recognise UTF-8 encoding

Post by *ghisler(Author) »

Thanks, I will consider it.
Author of Total Commander
https://www.ghisler.com
sitealpha
New Member
New Member
Posts: 0
Joined: 2022-05-21, 12:33 UTC

Re: Lister with default Explorer Preview mode may not recognise UTF-8 encoding

Post by *sitealpha »

I see that you are saying Lister with default Explorer Preview mode. When i curser to a file I want to view and do an F3. It defaults to image/multimedia. I then on the Lister window go to options and click 7 for utf-8 or 8 for explorer prieview. and then hit save position. When I go to configure it still does not offer a way to default to 7 or 8. If i go to multimedia tab in Lister configure and do the Define view methodby file type and use a txt amd set it up for 7 utf-8. It still opens everything up as a image/mulit. I tried to add picture but could not figure out how to insert.
Post Reply