Compare by Content: Show invisible characters in text mode
Moderators: Stefan2, Hacker, petermad
Compare by Content: Show invisible characters in text mode
Often when I compare two text files that look identical, TC will highlight lines as being different, but there is no visible difference between them. I suspect it flags these lines due to invisible character characters like spaces and tabs, but without being able to see them, I have to load the two files into a text editor, tell it to show invisible characters and compare them manually. It would be great if TC showed such characters when they differ between the two file. Other programs handle this by printing such characters in a different color and/or font.
Re: Compare by Content: Show invisible characters in text mode
For TC space is equal to tab - both are white spaces. There is also option to ignore repeated (white) spaces.
I think you should search for other characters, with almost invisible difference. Some punctuation marks for example, enlarged for better visibility:
` ' ´ (left accent, typewriter apostrophe, right accent)
- – — −(hyphen-minus, en dash, em dash, minus)
: ; (colon, semicolon)
I think you should search for other characters, with almost invisible difference. Some punctuation marks for example, enlarged for better visibility:
` ' ´ (left accent, typewriter apostrophe, right accent)
- – — −(hyphen-minus, en dash, em dash, minus)
: ; (colon, semicolon)
Andrzej P. Wozniak
Polish subforum moderator
Polish subforum moderator
Re: Compare by Content: Show invisible characters in text mode
Ignore repeated white spaces is already checked.Usher wrote: 2020-01-28, 14:17 UTC For TC space is equal to tab - both are white spaces. There is also option to ignore repeated (white) spaces.
Make a text file with four lines and save two copies of it. Call them Test1.txt and Test2.txt. In the first one, put an extra space at the end of the first line and in the second one, put an extra space at the end of the third line. You will have two text files with the exact same size, but if you try to compare them, they won't be identical. It will go to the comparison window, but since the differences are invisible, it doesn't show you anything and you can't jump to the next difference.
Re: Compare by Content: Show invisible characters in text mode
If you want to see all the differences, you should use binary compare. Text compare by default is designed to work with visible text and ignore white spaces.
What is more, there may be only different some EOLs (End Of Line characters), all the text and white spaces may be identical. How do you compare such files in a text editor?
What is more, there may be only different some EOLs (End Of Line characters), all the text and white spaces may be identical. How do you compare such files in a text editor?
Andrzej P. Wozniak
Polish subforum moderator
Polish subforum moderator
Re: Compare by Content: Show invisible characters in text mode
Now that there is bottom pane with only two lines of text, could the difference in white space be made visible at least in this pane?
Tabs and spaces might get different shades of colour, and these hues should differ from the pane background, so that whitespace at line ends was clearly shown.
Tabs and spaces might get different shades of colour, and these hues should differ from the pane background, so that whitespace at line ends was clearly shown.
- ghisler(Author)
- Site Admin

- Posts: 53139
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Compare by Content: Show invisible characters in text mode
There is unfortunately no simple way to do this - DrawText or Uniscribe can't be instructed to display white space, so the only way would be to replace white space with some other character. But what if the text actually contains that other character?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Compare by Content: Show invisible characters in text mode
White space is the background, and it could be changed. Of course, more than one DrawText call would be required.
Another option might be RichEdit (probably, overkill for the task).
Another option might be RichEdit (probably, overkill for the task).
- ghisler(Author)
- Site Admin

- Posts: 53139
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Compare by Content: Show invisible characters in text mode
But it wouldn't help to just show it inverted, you couldn't see this way whether it's two or three spaces.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Compare by Content: Show invisible characters in text mode
File 0:
File 1:
File 1 uses spaces only; no trailing whitespace.
The invisible difference in comparison would be tab after Changes in file 0 and space at the end of line.
Mock-up Image: https://jumpshare.com/s/HXPBpY6NHoSTDStW1XAw (never mind highlighted "to" in the picture).
Should tab be expanded to more than one character place, all should be painted with tab colour.
By the way, when making Compare window's height very low, first the bottom pane hides the main panes, then status pane disappears.
Not a huge bug, but could be improved.
Code: Select all
Changes from version 1.6.45 to version 1.6.46 Code: Select all
Changes from version 1.6.52 to version 1.6.53The invisible difference in comparison would be tab after Changes in file 0 and space at the end of line.
Mock-up Image: https://jumpshare.com/s/HXPBpY6NHoSTDStW1XAw (never mind highlighted "to" in the picture).
Should tab be expanded to more than one character place, all should be painted with tab colour.
By the way, when making Compare window's height very low, first the bottom pane hides the main panes, then status pane disappears.
Not a huge bug, but could be improved.


