[TC] Sometimes, Internal Viewer (Ctrl-q) fails to search a keyword in a non-unicode (cp949) *.txt

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

Moderators: white, Hacker, petermad, Stefan2

Post Reply
cpp64
Junior Member
Junior Member
Posts: 83
Joined: 2023-05-12, 16:03 UTC

[TC] Sometimes, Internal Viewer (Ctrl-q) fails to search a keyword in a non-unicode (cp949) *.txt

Post by *cpp64 »

OS: Windows 11 x64
OS-Locale: Korean
TC: 11.00rc1 x64

[ 1 ]
----- cp949-001.txt
애수
가나다라마바사
아자차카타파하
-----

The cp949-001.txt is displayed well in the Internal Viewer.

But it fails when searching a keyword and copying-and-pasting strings.

When searching "가나다", TC shows a message "Not found, 가나다".

And when copying-and-pasting all the strings from TC into Notepad,
Notepad shows
-----
¾Ö¼ö
°¡³ª´Ù¶ó¸¶¹Ù»ç
¾ÆÀÚÂ÷īŸÆÄÇÏ

-----
.


[ 2 ] without "애수"
----- cp949-002.txt
가나다라마바사
아자차카타파하
-----
is OK in all tests.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC] Sometimes, Internal Viewer (Ctrl-q) fails to search a keyword in a non-unicode (cp949) *.txt

Post by *ghisler(Author) »

I will check it, thanks for your report.
Edit:
Can you tell me what is set in the menu "Encoding"? Is it set to
- As configured for current font
or
- ANSI (0)
or
- Korean (949)

I ask because with my current locale, I have to set it to Korean (949), and then both the search and the copying of text work fine.
Could you please try with the other two options?
Author of Total Commander
https://www.ghisler.com
cpp64
Junior Member
Junior Member
Posts: 83
Joined: 2023-05-12, 16:03 UTC

Re: [TC] Sometimes, Internal Viewer (Ctrl-q) fails to search a keyword in a non-unicode (cp949) *.txt

Post by *cpp64 »

2ghisler

I found it.

==============================
OS: Windows 11 x64
OS-Locale: Korean
TC: 11.00rc1 x64

[Font at startup] Autodetect

[Encoding] As configured for current font

[ANSI] Hack,-40,0,D144
--> script: Western (any monospaced font that doesn't have Korean)

[ASCII] Courier New,-96,0,D144
--> script: Western (any monospaced font that doesn't have Korean)

[Variable] Batang,-40,129,D144
--> script: Hangul (any font that has Korean)
==============================

cp949-001.txt with "애수" is opened as ANSI. (Hack) // It seems that "ANSI + Western" is applied, not "ANSI + local code page".

cp949-002.txt without "애수" is opened as ASCII. (Courier New) // This is OK.

------------------------------

[Encoding] ANSI (local code page) (0)
[Encoding] ASCII/DOS (local code page) (1)
[Encoding] cp949
are OK.

However, the displayed font for both English and Korean is "GulimChe".

------------------------------

[Encoding] MacOS (2)
is OK.

"Alphabet + Korean" in TXT:
The displayed font for English is Hack,-40,0,D144
and for Korean is Malgun Gothic (Windows' default font link for Korean).

"Alphabet only" in TXT:
The displayed font for English is MacOS property font.

------------------------------


ps.

Keeping Ctrl-q with Autodetct,

[ . --(down key)--> cp949-001.txt ] cp949-001.txt is opened as ANSI
and
[ cp949-002.txt --(up key)--> cp949-001.txt] cp949-001.txt is opened as ASCII

In some cases, previous encoding with Autodetect seems to affect subsequent encoding.
Last edited by cpp64 on 2023-07-14, 01:51 UTC, edited 4 times in total.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC] Sometimes, Internal Viewer (Ctrl-q) fails to search a keyword in a non-unicode (cp949) *.txt

Post by *ghisler(Author) »

So if I understand you correctly, it misbehaves when using "As configured for current font" when the font does not include Korean encoding?
Author of Total Commander
https://www.ghisler.com
cpp64
Junior Member
Junior Member
Posts: 83
Joined: 2023-05-12, 16:03 UTC

Re: [TC] Sometimes, Internal Viewer (Ctrl-q) fails to search a keyword in a non-unicode (cp949) *.txt

Post by *cpp64 »

ghisler(Author) wrote: 2023-07-14, 09:38 UTC So if I understand you correctly, it misbehaves when using "As configured for current font" when the font does not include Korean encoding?

Yes, ANSI + "any monospaced fonts with Font script [Western]" + "As Configured for current font" causes the problem when copying and pasting text from TC to another editor.

// Hangul == Korean
This means that any monospaced fonts without Hangul will always cause the problem.

It seems that the locale of the OS (cp949) does not apply to it.


# Font script: Western
----------------------------------------------------------------------------------------------------
ANSI + Font script [Western] + "As Configured for current font"
----------------------------------------------------------------------------------------------------

Hack (without Korean) that has "Font script, [Western]" causes the problem when the font script is [Western].

D2Coding (eng + kor) that has "Font script, [Western + Hangul]" also causes the problem when the font script is [Western].

This is the same as if "[Encoding] Western Latin1 (1252)" were selected in Lister's Encoding submenu.


# Font script: Hangul (Korean)
----------------------------------------------------------------------------------------------------
ANSI + Font script [Hangul] + "As Configured for current font"
----------------------------------------------------------------------------------------------------

D2Coding (eng + kor) that has "Font script, [Western + Hangul]" is OK when the font script is [Hangul].


ps.

[D2Coding]
https://github.com/naver/d2codingfont

[Hack]
https://github.com/source-foundry/Hack
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [TC] Sometimes, Internal Viewer (Ctrl-q) fails to search a keyword in a non-unicode (cp949) *.txt

Post by *ghisler(Author) »

I found the problem: When I create a font with the encoding set to 0, it creates a font with the encoding of current locale/language. But TC was assuming that it would be creating a font with "Western" encoding, because that's what the font choose dialog returns when you choose "Western". So the displayed encoding (Korean) differs from what TC assumes. I will fix it.
Author of Total Commander
https://www.ghisler.com
cpp64
Junior Member
Junior Member
Posts: 83
Joined: 2023-05-12, 16:03 UTC

Re: [TC] Sometimes, Internal Viewer (Ctrl-q) fails to search a keyword in a non-unicode (cp949) *.txt

Post by *cpp64 »

Confirmed fixed in tc-11.00-rc2
User avatar
white
Power Member
Power Member
Posts: 4623
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: [TC] Sometimes, Internal Viewer (Ctrl-q) fails to search a keyword in a non-unicode (cp949) *.txt

Post by *white »

Moderator message from: white » 2023-07-19, 22:53 UTC

Moved to Fixed bugs.
Post Reply