Lister doesn't copy selection in UTF8 BOM files

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

Moderators: white, Hacker, petermad, Stefan2

dantesoft
Junior Member
Junior Member
Posts: 29
Joined: 2005-06-06, 15:55 UTC

Lister doesn't copy selection in UTF8 BOM files

Post by *dantesoft »

1. Create a text file, UTF-8 encoded, with BOM, e.g.

Code: Select all

test1234
(hex view would be ef bb bf 0d 0a 74 65 73 74 31 32 33 34)
2. View in lister (UTF-8 mode is auto-selected)
3. copy the test1234 word (double-click or drag mouse to select, then CTRL+C)

The clipboard selection is "t1234" instead of "test1234".
The copy succedes only if the file is viewed in Lister's "text only", "binary" or "hex".
User avatar
ND
Member
Member
Posts: 150
Joined: 2006-04-10, 16:24 UTC
Location: Sibiu, RO

Post by *ND »

Confirmed (TC 7.02a, WinXP Pro SP2)
aNDreas Bolotă
The truth always carries the ambiguity of the words used to express it. (Frank Herbert, God Emperor of Dune)
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

Confirmed (TC 7.02a, Win2k SP4), with the hex data posted by dantesoft

But only, if the first character is included: selecting + copying only "est1234" works as expected.

The same occurs after selecting via keyboard, no matter in what direction.
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

It seems that I have fixed this in the meantime, I cannot reproduce it with TC 7.5 beta (non-public). However, I can select 3 characters beyond the end of the line, something which I couldn't correct so far (but which doesn't cause any harm). The reason of both of these behaviours is the damn UTF8 byte order mark (BOM).
Author of Total Commander
https://www.ghisler.com
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2ghisler(Author)
I cannot reproduce it with TC 7.5 beta (non-public)
Did I miss anything? ;-)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

No you didn't, I meant the version on which I'm currently working, I wasn't refering to a non-public beta test. :)
Author of Total Commander
https://www.ghisler.com
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

Not changed in TC 7.03
(Win2k SP4)
The clipboard selection is "t1234" instead of "test1234".
BTW: Doubleclicking on the last character does not create any selection
(it should select the word under the mouse cursor like with "normal" files).
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Strange, it works fine for me here in TC 7.03 on Win2k!

1. Create file in notepad
2. Write text test1234 in it (NO Enter)
3. Save in utf-8 format
4. Press Alt+Shift+F3 on file to avoid any lister plugins
5a. Select text with double click
6a. Ctrl+C, then Ctrl+V in notepad -> test1234 is pasted

5b. Select with mouse
6b. Ctrl+C, then Ctrl+V in notepad -> test1234 is pasted

5b. Select with keyboard (Shift+Cursor keys)
6b. Ctrl+C, then Ctrl+V in notepad -> test1234 is pasted

However, the cursor can still be placed 3 characters behind the text with the cursor keys, this is a known problem.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14808
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

I can confirm the behaviour as just described by ghisler(Author) under Win XP SP2.

But I can NOT reproduce the bug in TC 7.02a either! Maybe it is a font related problem? I am using the standard font setting for Lister.
Doubleclicking on the last character does not create any selection
That, I can confirm in both 7.02a and 7.03
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

ghisler(Author) wrote:2. Write text test1234 in it (NO Enter)
Yes, this way I don't get the bug, too.
If you put a CR before the string, like described in the OP, the bug occurs here - both in Win2k SP4 and XP SP2:
dantesoft wrote: (hex view would be ef bb bf 0d 0a 74 65 73 74 31 32 33 34)
You can download the test file here, looking like this:

Code: Select all

test1234
=>
The clipboard selection is "t1234" instead of "test1234".
and
Doubleclicking on the last character does not create any selection
2petermad
I am using the standard font setting for Lister.
So do I.
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
User avatar
petermad
Power Member
Power Member
Posts: 14808
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

I can confirm the bug with the provided file.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Ah, I see - it doesn't occur on the first line, but on the SECOND line! For some strange reason, Lister seems to subtract the BOM also on the second line. Thanks for making that clear.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14808
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

Copy bug fixed in TC 7.04.

But doubleclick on last character still doesn't select the whole word.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

Confirm fix of copy bug in 7.04.
petermad wrote:But doubleclick on last character still doesn't select the whole word.
Yes, confirmed.

Additionally, when you click and drag from somewhere at the text beginning to the end of the line:
the last two characters are marked both at the same time.
(The test file is still here.)
Marking only one of the last two characters ("test123") is not possible when dragging from the left,
although it is possible when starting to drag between the last two ("3" and "4").
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Unfortunately I couldn't get it to work better than it is now, sorry.
Author of Total Commander
https://www.ghisler.com
Post Reply