Right to left text in Compare tool

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
browny
Senior Member
Senior Member
Posts: 288
Joined: 2007-09-10, 13:19 UTC

Right to left text in Compare tool

Post by *browny »

TC 11.01 in the current Windows 11 US English.

Two tiny files i1 and i2 are in UTF-8, right to left language, should be in the archive here: cmp.7z (194 bytes).
The second one contains parenthesized text; in Notepad is looks like this: "(xxx) x".
Comparison tool displays text as left to right though this is not a problem yet.
Some editors do the same, show text like "x (xxx)", but after changes and saving it would be correct in Notepad.
The problem is, Comparison tool displays text as "x ((xxx" - different parenthesis in the wrong place.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Right to left text in Compare tool

Post by *ghisler(Author) »

Unfortunately right to left text isn't currently supported in the compare tool sorry.
Author of Total Commander
https://www.ghisler.com
browny
Senior Member
Senior Member
Posts: 288
Joined: 2007-09-10, 13:19 UTC

Re: Right to left text in Compare tool

Post by *browny »

Is it correct to say that Lister has no right to left text support too?
Sometimes in UTF-8 it displays parenthesized text in left to right order, while other files will have two opening parentheses.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Right to left text in Compare tool

Post by *ghisler(Author) »

No, Lister does have right to left text support in text and Unicode UTF-16 and UTF-8 modes. Your files are detected as binary because they don't have any line breaks. Switch to UTF-8 mode manually, then it should work fine.

To switch to right aligned mode, hold down the Ctrl key and press and release the right shift key.
To switch back to left aligned mode, hold down the ctrl key and press and release the left shift key.

Please provide a sample file if you find one which doesn't work.
Author of Total Commander
https://www.ghisler.com
browny
Senior Member
Senior Member
Posts: 288
Joined: 2007-09-10, 13:19 UTC

Re: Right to left text in Compare tool

Post by *browny »

lister.7z
Notepad shows all three files with pared parentheses.

ir21 is reasonably good in both left to right and right to left
ir2.b has BOM - also good
ir2.n no BOM - wrong display in left to right "((x"

Possibly text drawing has started as left to right, then switched to the inverse order.
Last edited by browny on 2023-09-13, 11:11 UTC, edited 1 time in total.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Right to left text in Compare tool

Post by *ghisler(Author) »

Interestingly, when you press Ctrl+ right shift, then ir2.n appears just fine. Maybe it's not a TC bug...
Author of Total Commander
https://www.ghisler.com
User avatar
AntonyD
Power Member
Power Member
Posts: 1249
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: Right to left text in Compare tool

Post by *AntonyD »

2browny
and which encoding IS a correct one for these files?
IMHO it should be more correctly - if you could supply us with screens of the proper rendering of all of these files.
#146217 personal license
browny
Senior Member
Senior Member
Posts: 288
Joined: 2007-09-10, 13:19 UTC

Re: Right to left text in Compare tool

Post by *browny »

ghisler(Author) wrote: 2023-09-13, 09:25 UTC Interestingly, when you press Ctrl+ right shift, then ir2.n appears just fine. Maybe it's not a TC bug...
Notepad made no mistakes.

AntonyD, this is UTF-8 text as written in the opening post.
User avatar
AntonyD
Power Member
Power Member
Posts: 1249
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: Right to left text in Compare tool

Post by *AntonyD »

this is UTF-8 text
So in this case - all file are opening correctly....
So where is the problem? Maybe screen-shots?
Because mentioned "((x" - I don't see at anywhere(((
#146217 personal license
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Right to left text in Compare tool

Post by *ghisler(Author) »

Sorry, I don't know why Lister displays it incorrectly when it's left-aligned. Maybe someone native Arabic has an idea what could be the problem.
Author of Total Commander
https://www.ghisler.com
browny
Senior Member
Senior Member
Posts: 288
Joined: 2007-09-10, 13:19 UTC

Re: Right to left text in Compare tool

Post by *browny »

Using an ordinary edit text control and trying to type and copy&paste these characters one by one was a lot of fun.
For those who used to left to right text, arrow keys and backspace move and delete in weird ways.
browny
Senior Member
Senior Member
Posts: 288
Joined: 2007-09-10, 13:19 UTC

Re: Right to left text in Compare tool

Post by *browny »

Maybe this is the way to write a sequence of characters and ignore the direction of reading.
https://stackoverflow.com/questions/33156889/windows-right-to-left-characters-output-using-textout
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Right to left text in Compare tool

Post by *ghisler(Author) »

Moderator message

Moved to suggestions forum
Author of Total Commander
https://www.ghisler.com
Post Reply