Page 2 of 2

Re: Lister and UTF-8 option

Posted: 2021-09-01, 15:22 UTC
by petermad
2tommy0910
You can also instead do it via configuring Lister's "Define view method by file type" and set the value for *.txt files to 7:

See: https://madsenworld.dk/tcmd/listertextasutf8.png

.

Now, how to quick-view HTML + UTF8 --- together?

Posted: 2023-11-12, 15:48 UTC
by shula
As per Petermads suggestion, "Define view method by file type",
I can now see UTF-8 files by default,

but now HTML files aren't being formatted as Text ("strip tags" view option = 5 )
"<body><p>hello <b>world</b></p>" -> "hello world"

What I tried:
  • strip HTML tags, codepage=UTF-8:

    Code: Select all

    %COMMANDER_EXE% /S=L:C65001T5
  • setting both UTF-8 and HTML at the same time:

    Code: Select all

    %COMMANDER_EXE% /S=L:T7T5
here:
Image: https://pasteboard.co/L8qhu65ai1Ey.png

undesired example: UTF8=yes, HTML=No.
Image: https://pasteboard.co/wla4PjY2EYlb.png

is that possible internally?
or with a plugin?

Re: Lister and UTF-8 option

Posted: 2023-11-12, 19:42 UTC
by petermad
You cannot put %COMMANDER_EXE% or other programs in for the plugin, you can only use what is available when you click the [+] button in the dialog where it says: "Please choose default view modes" see upper right corner of the screenshot: https://madsenworld.dk/tcmd/listertextasutf8.png

So instead of %COMMANDER_EXE% /S=L:T7T5 you should put in:

Code: Select all

5,7
in that dialog box. Then pressing F3 on a .htm* file will open it in mode 5 (HTML text (strip tags)) - if you press 4 it will shift to mode 7 (UTF-8)

If the .html file has the proper meta tag:

Code: Select all

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
Then TC will automatically show mode 5 as UTF-8 - it is not enough that the file has BOM, the meta tag has to be in the html file.

While in mode 5 you can force UTF-8 by pressing 7.