Improvement for file comparison dialog

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

User avatar
AntonyD
Power Member
Power Member
Posts: 1246
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Improvement for file comparison dialog

Post by *AntonyD »

AS we all know there is a button on this dialog: "ANSI<->ANSI"
which allows to choose the text encoding type, e.g. one side UTF-8 and the other ANSI if the text type was not detected automatically.

BUT in a mode 'ANSI' there is no such necessary opportunities like
Encoding menu. Which exists for example at Lister tool.

IMHO this feature could be rather easily added for "ANSI<->ANSI" action.
It could be added (to be more precisely) at the "Dialog box: Choose encoding"
For now it contains the simplest checkbox "ANSI (plain text)"
In a help we read about this element: "The chosen font determines the encoding of the text."
Hence and exactly here should be added a very useful combobox with the same functionality as Encoding menu works at Lister tool.
Last edited by AntonyD on 2016-08-10, 11:02 UTC, edited 2 times in total.
#146217 personal license
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Support.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

TC cannot compare two ANSI files with different encoding. If you want to compare ANSI with Unicode, you can choose the encoding in the font settings: This is relevant only for ANSI, since Unicode supports all encodings and doesn't use the encoding option from the font.
Author of Total Commander
https://www.ghisler.com
User avatar
AntonyD
Power Member
Power Member
Posts: 1246
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Post by *AntonyD »

I have done translation - but I couldn't understand it.
Your suggestions as I understood - is to change font settings globally? For all TC dialogs? forms? settings?
But I talked about it - only in a local context!
Again - existing form "Dialog box: Choose encoding" should have not only checkboxes
ANSI (plain text)
Unicode (UTF-16)
Unicode (MacOS)
UTF-8
but also and a combobox - in which font encoding I want to redraw the OUTPUT of already compared context of the file!
Hence I want to say that your tool already did the compare process. Maybe using only ASCII mode. Does not matter. All is fine.
But now I want to force to redraw the output of comparison window in a different font encoding. As your Lister tool can easily do this.
#146217 personal license
browny
Senior Member
Senior Member
Posts: 288
Joined: 2007-09-10, 13:19 UTC

Post by *browny »

Anton,
ANSI uses one byte per character, Unicode uses multiple bytes, therefore changed encoding requires recompare.

However, it might be possible and even useful to add switching between Windows and DOS charsets as in Lister.
Or even select code page in ANSI mode.
User avatar
AntonyD
Power Member
Power Member
Posts: 1246
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Post by *AntonyD »

ANSI uses one byte per character, Unicode uses multiple bytes, therefore changed encoding requires recompare.
I know that. But I did no say anywhere that I vote in this feature's implementation about recomparing after file's encode change.

I vote exactly about the ability:
to add switching between Windows and DOS charsets as in Lister.
Or even select code page in ANSI mode.
AFTER the compare process. So the only thing which I want here - is to REDRAW the output with different encode/font charset.
On this moment all differences were found. Their positions at text were defined. So - tool should only allow to me - to redraw this specifically formatted text with a different font charset/encode.
#146217 personal license
User avatar
AntonyD
Power Member
Power Member
Posts: 1246
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Post by *AntonyD »

So, dear ghisler, what do you think now - after my last clarifications?
#146217 personal license
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Did you try to change the charset in the font settings?
Author of Total Commander
https://www.ghisler.com
User avatar
AntonyD
Power Member
Power Member
Posts: 1246
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Post by *AntonyD »

Looks like you did not understand the main part of my suggestion.
Image: http://savepic.ru/10986546.png
Here is the list of available charsets, which I can get at the standard Font dialog.
This dialog I can issue from the comparison window itself - yes, there is an appropriate button on the form.
"Шрифт" - in my translation.
BUT the list of available charsets here is super-minimalistic!
And it is non-configurable unlike the list from Lister tool.
Just compare it with the desirable charsets list from Lister tool:
Image: http://savepic.ru/11004981.png

AND - what is THE MOST important thing - IF I will choose charset at Font dialog it will be applied ON BOTH panels of comparison window simultaneously.
But I am talking to you about the ability to choose charset for each panel in this window separately!
And of course only for the ANSI context of compared file.

P.S. for an example files which I've compared - I had to choose ASCII/DOS charset which never was and never will exist
at standard Font dialog.
So only the configurable list of charsets - which was designed for Lister tool can help me at comparison window in such case.
#146217 personal license
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

BUT the list of available charsets here is super-minimalistic!
And it is non-configurable unlike the list from Lister tool.
Yes, Windows only shows the charsets which that font does contain. You need to try a different font for other charsets. Microsoft Sans Serif contains a lot. Charsets which are not listed are created by composition with other fonts, which normally looks quite ugly.

For ASCII/DOS, you need to use even other fonts.
Author of Total Commander
https://www.ghisler.com
User avatar
AntonyD
Power Member
Power Member
Posts: 1246
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Post by *AntonyD »

2ghisler(Author)
Again, dear ghisler - I wrote to you - I need a ~separate~ ability to choose charsets for visual output of one of compared file.
SEPARATE ability. For the left panel and for the right panel.
You still now in your answers is pushing me in the direction of the existing ability to choose and to change ONE charset for BOTH panels simultaneously.
Do you want to say that to implement a separate listboxes with charsets which you already have done for the Lister tool inside the comparison window for the left and the right panels is impossible?

Again, in my scenario of work (which is not so rare as it may seem) on left panel I have ms-dos like file - on the right panel I have win-1251/1252/1255 file.
SO yes - these files have a BYTE difference. Which also is a visual difference because they are using ~the same~ only one font for output - which has only ONE WIN charset which has been chosen forcibly by def.settings of standard Font dialog. Hence right panel looks like correctly. And then - only when the right file initially is in the encoding for which def.charset of def.settings of standard Font dialog will give the best view.
But If i can change separately left panel charset on ASCII/DOS - i can get visual identity for these files. For ex. for ASCII-866 and CP-1251.
This is - what I wanted very much.
#146217 personal license
browny
Senior Member
Senior Member
Posts: 288
Joined: 2007-09-10, 13:19 UTC

Post by *browny »

AntonDudarenko wrote:2ghisler(Author)
choose charsets for visual output of one of compared file.
SEPARATE ability. For the left panel and for the right panel.
The same byte code might lood differently in different encodings,
and different byte codes might have the same character graphics.

The only logical approach would be to change encoding for both panes together, not separately.

ANSI/DOS swicth might be really useful to compare files in cp866.
User avatar
AntonyD
Power Member
Power Member
Posts: 1246
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Post by *AntonyD »

The only logical approach would be to change encoding for both panes together, not separately.
no-no-no! only separate! because only `I` know at current step that left of right file needs changes in the visual representation.
The Compare process was done before this step. So, There is no needs to compare files after changing charsets for only visual redrawing of files' context. So now only my logic and my needs are valuable.
I understand completely that I want on this moment.
#146217 personal license
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

AntonDudarenko,
Since multiple codepages use same bytes for different characters, I only see any logic in comparing an ANSI file with special codepage with some Unicode file. However this means that encoding must be set before comparing, otherwise there will be no way to match non-latin characters.

I don't see any sense in comparing two ANSI files in different codepages because there will be no matching non-latin characters between them. And I don't see too much sense in comparing only latin characters between two files in different encodings...

But of course there should be a way to set encoding for each side.
browny
Senior Member
Senior Member
Posts: 288
Joined: 2007-09-10, 13:19 UTC

Post by *browny »

You have to know encoding before comparison for text compare tool.

Let's say in code page 1 chr($80) is "A" and chr($81) is "B"
While in code page 2 chr($80) is "B" and chr($81) is "A".

Byte strings chr($80)+chr($81) in cp1 would be "AB", but in cp2 it would be "BA".
That is byte equal, but the text is different.
Post Reply