Text comparison of files w/wo BOMs

General questions about using ExamDiff Pro, ideas for new features, bug reports, and usage tips.
Post Reply
rho
New Member
Posts: 3
Joined: Tue May 15, 2012 9:12 am

Text comparison of files w/wo BOMs

Post by rho »

When I compare two files in text mode which are identical except for the existence of a leading byte order mark (BOM) ExamDiff shows no difference. Comparing them in binary mode shows the difference. (All done with ED Pro 5.5.1.8 )

I have two issues with the current behaviour/functionality.

a) There is no mean to trigger any visual indication in text comparison mode that a BOM exists. I assume this comparable to the "View whitespace" and "View EOLs" switches.
b) There is no mean to enable/disable that BOMs are ignored during comparison pretty much like I can select to ignore linebreak styles.

ED already contains some logic to handle BOMs, otherwise the files would be treated as different even in text mode. So I assume it is a minor change to give the user some control about how ED should treat differences of that type.
User avatar
psguru
Site Admin
Posts: 2231
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Re: Text comparison of files w/wo BOMs

Post by psguru »

I have to disagree with this: using text comparison for Unicode files assumes that what you see on the screen is not exactly what the bytes that make up the file are, that a certain translation happens before the files are compared/shown. I don't know of any text editors that would show BOMs in text mode.

Binary comparison, on the other hand, shows the bytes themselves, and EDP properly handles this, just like editors do in HEX mode.
psguru
PrestoSoft
rho
New Member
Posts: 3
Joined: Tue May 15, 2012 9:12 am

Re: Text comparison of files w/wo BOMs

Post by rho »

I am not happy with your reply. If I follow your reasoning, then I wonder why you ever implemented the logic handling different line break styles in text comparison mode.

The line break is indirectly visible by triggering the beginning of a new line. By default, no "character" is shown for a line break in text comparsion. Nevertheless there is an extra feature built-in EDP that allows me to visualize different line break sequences even in text mode (the View End-Of-Line Markers button/menu item). And on top of that, there is an extra switch in the comparison options to regard or disregard changes in line break styles for a text comparison.
You may also consider some other logic built-into EDP that throws the message "No newline at end of file". Again, some indication about an "invisible" difference in text comparison mode.

The BOM is of similar quality, although is occurs only once at the beginning of a file.

Why did I ask for that feature? Fairly simple, I use EDP to detect changes in files. And my expectation is that as long as I do not enable any of the various ignore options EDP will tell me about differences in files, even if I do a comparison in text mode. I really rely on that and I assume it impractical to perform all my comparisons in binary mode just to be really sure to detect a difference at all.
User avatar
psguru
Site Admin
Posts: 2231
Joined: Sat May 15, 2004 4:23 pm
Location: California
Contact:

Re: Text comparison of files w/wo BOMs

Post by psguru »

I see your point. However, adding such a feature is not as simple as it sounds, and the feature itself, unfortunately, has not been requested until now.

As for similarities with EOL or white space comparison and visibility, EDP pretty much follows what regular editors do (which I mentioned in my previous post): most of them allow showing of EOLs and white space, yet I'm not aware of any editor that allows showing of BOMs.
psguru
PrestoSoft
Post Reply