Wrong judgement of .TXT files in lister

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Woailizhi
Junior Member
Junior Member
Posts: 66
Joined: 2020-11-14, 08:05 UTC
Location: Poland
Contact:

Wrong judgement of .TXT files in lister

Post by *Woailizhi »

Hi,
I very often need to read CHinese text. When I read seriously, I use Notepad Plus Plus, but when I want to peek at the file's contents, I try to use TC. Some files are OK, but some don't read Chinese but garbled characters. How can I change the encoding in lister?

With best regards,
Nuno.

With eterenal love to history and China.
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Wrong judgement of .TXT files in lister

Post by *Dalai »

Woailizhi wrote: 2021-06-23, 12:45 UTCHow can I change the encoding in lister?
Either via menu Options > UTF-8 (or ANSI), or via the Encoding menu.

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
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Wrong judgement of .TXT files in lister

Post by *ghisler(Author) »

It may be incorrectly detected as ASCII. Just press 'a' to switch to Ansi.
Or as Ansi instead of UTF-8 (or the reverse), then press '7' (or '1').
Author of Total Commander
https://www.ghisler.com
Woailizhi
Junior Member
Junior Member
Posts: 66
Joined: 2020-11-14, 08:05 UTC
Location: Poland
Contact:

Re: Wrong judgement of .TXT files in lister

Post by *Woailizhi »

It still shows garbled characters. Where can I upload the test file?

With best regards,
Nuno.

With eterenal love to history and China.
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Wrong judgement of .TXT files in lister

Post by *Hacker »

Woailizhi,
For example OneDrive or Google Drive.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Woailizhi
Junior Member
Junior Member
Posts: 66
Joined: 2020-11-14, 08:05 UTC
Location: Poland
Contact:

Re: Wrong judgement of .TXT files in lister

Post by *Woailizhi »

I thought so but I was afraid it would be inappropriate.
https://drive.google.com/file/d/1zmkRpugFLW4TL8jTXAF0l_83l_DXqBgM/view?usp=sharing

With best regards,
Nuno.

With eterenal love to history and China.
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Wrong judgement of .TXT files in lister

Post by *Dalai »

2Woailizhi
The default font used by TC for monospace fonts (Fixedsys) doesn't seem to support the characters. If you switch to Consolas and then change the Encoding to something "Chinese", it should work (it does for me on a German system).

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
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Wrong judgement of .TXT files in lister

Post by *Usher »

Dalai wrote: 2021-06-23, 16:40 UTC The default font used by TC for monospace fonts (Fixedsys) doesn't seem to support the characters. If you switch to Consolas and then change the Encoding to something "Chinese", it should work (it does for me on a German system).
Wrong. Consolas doesn't support Chinese. In some cases either system or TC may automatically recognize encoding and use the proper font instead.

2Woailizhi

There are at least two ways to do what you need:

1. Don't change anything in Lister configuration. Use default fonts and when you need select proper encoding from Lister menu - either "Chinese Main Land" (Simplified, GB2312) or "Chinese Taiwan" (Traditional, Big5). In this case TC will automatically use Chinese fonts installed in your system.
EDIT 1: This option is automatically saved as "Codepage=936" or "Codepage=950" respectively in wincmd.ini in [Lister] section and stays selected until the user change it manually.
EDIT 2: Not all characters will be displayed with Chinese fonts. Monospaced font set for ANSI/DOS will be used for US-ASCII subset (Latin letters and numbers seen in the linked text).

2. Configure "Variable" font in Lister. Select your favorite Chinese font and Chinese script in Lister, save settings and press "V" whenever Lister displays wrong characters rather than Chinese.

I use the second method for Russian text, the first one - for other encodings, including manually added DOS, KOI8 and iso-8859-* charsets.
Last edited by Usher on 2021-06-24, 17:03 UTC, edited 4 times in total.
Andrzej P. Wozniak
Polish subforum moderator
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Wrong judgement of .TXT files in lister

Post by *Dalai »

Usher wrote: 2021-06-23, 22:17 UTCWrong. Consolas doesn't support Chinese.
It works for me with the settings I described. See this screenshot. Although I can't read Chinese I see that the characters look exactly the same as in Notepad++ and the preview on Woailizhi's Google Drive. However, it seems my system may be doing some font substitution and use a different font entirely, because Courier New and Lucida Console and even an explicitely set Fixedsys show the same type face. Anyway, I just wrote what works/worked for me.

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
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Wrong judgement of .TXT files in lister

Post by *Usher »

2Dalai
I suspect that you haven't described all your previous actions and haven't read my previous message carefully enough.
Start TC with a fresh ini and follow steps for the first method described in my previous message. I've edited the description to be more clear. If you want to do a screenshot, show the file name (don't cut the Lister titlebar) and your settings in Lister menu "Encoding". Then you can restart TC with the same ini and compare current Lister view for the same file with the view saved as screenshot. Then change Encoding to default, restart TC with the same ini again and view the same file once more.
Andrzej P. Wozniak
Polish subforum moderator
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Wrong judgement of .TXT files in lister

Post by *Dalai »

2Usher
The selected Encoding is/was one of the Chinese ones, of course. I conducted my tests with a default wincmd.ini in my portable TC 9.51, an SFX archive so it uses the same settings every time. Then I opened the file, changed the font and Encoding in Lister and it was displayed correctly.

BTW, the Lister titlebar is completely irrelevant, or it doesn't provide any additional useful/relevant information. What's important is that it's the same file, which I can assure you it is.

That's enough semi off-topic from me. We should wait for the OP to respond.

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
User avatar
Usher
Power Member
Power Member
Posts: 1675
Joined: 2011-03-11, 10:11 UTC

Re: Wrong judgement of .TXT files in lister

Post by *Usher »

Dalai wrote: 2021-06-24, 21:13 UTC 2Usher
BTW, the Lister titlebar is completely irrelevant, or it doesn't provide any additional useful/relevant information. What's important is that it's the same file, which I can assure you it is.
Did you really use the same 更新日志.txt file saved in ANSI encoding?

Maybe it's too hot for me. I don't understand your message, there's too many to guess for me. I would prefer step-by-step description. I'm pretty sure that your font change is irrelevant.

I prefer solution which is suitable for working with two languages at a time (for example, Polish and Russian or Polish and Chinese). Using Lister menu "Encoding" in this case is not an option.
Andrzej P. Wozniak
Polish subforum moderator
Post Reply