+[8.5b2] Compare & Edit: Unicode problem
Moderators: Hacker, petermad, Stefan2, white
+[8.5b2] Compare & Edit: Unicode problem
0. Maybe you will need non-US codepage to reproduce this bug (Russian in my case).
1. Open Notepad and type some non-English characters (from second half of your codepage; in my case some Russian letters).
2. Then switch keyboard layout to English (!) and copy typed text.
3. Try to paste text to Compare & Edit window: wrong text is inserted (in my case it is inserted as ??????????).
4. To ensure it is TC problem and not Notepad, open some other Unicode application, e.g. write.exe or Word, and insert text into it. Correct text is isnerted.
So, Compare & Edit always takes ANSI format from clipboard even if Unicode one is there also. But it should take Unicode one if available.
1. Open Notepad and type some non-English characters (from second half of your codepage; in my case some Russian letters).
2. Then switch keyboard layout to English (!) and copy typed text.
3. Try to paste text to Compare & Edit window: wrong text is inserted (in my case it is inserted as ??????????).
4. To ensure it is TC problem and not Notepad, open some other Unicode application, e.g. write.exe or Word, and insert text into it. Correct text is isnerted.
So, Compare & Edit always takes ANSI format from clipboard even if Unicode one is there also. But it should take Unicode one if available.
- ghisler(Author)
- Site Admin
- Posts: 50861
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
The problem is that notepad doesn't set the codepage, so when TC requests the ANSI clipboard, Windows makes the wrong conversion.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
I know that Windows puts ANSI text to clipboard with codepage taken according to current keyboard layout.
But any Unicode application puts Unicode text to clipboard and Compare&Edit should use it first but it doesn't.
Please check, it seems that Compare&Edit clipboard reading function uses CF_TEXT format while it should use CF_UNICODETEXT format.
But any Unicode application puts Unicode text to clipboard and Compare&Edit should use it first but it doesn't.
Please check, it seems that Compare&Edit clipboard reading function uses CF_TEXT format while it should use CF_UNICODETEXT format.
- ghisler(Author)
- Site Admin
- Posts: 50861
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Compare uses Unicode clipboard only when editing Unicode or UTF-8 file.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50861
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Hmm, maybe better use the codepage set for the current font.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50861
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Interestingly I was already using the Unicode clipboard in the 64-bit version. I will use it in the 32-bit version too.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50861
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact: