1

My problem is twofold. I'm using Beyond Compare integrated with Visual Studio 2015 as my Compare/Merge tool. While looking at my list of 'Pending Changes', I see a file which if I 'Right Click -> Source Control -> Compare with Latest Version', I can see no differences in the text compare as you can see below:

Text Compare - Note (for later) the bit I've highlighted

However, if I do a hex compare of the same, I get the following result:

Hex Compare - BOM at the start

I can see it's somehow gotten the EF BB BF at the starting and the Beyond Compare notes this difference with a red bar in the left side window.

On other occasions, I've seen files in 'Pending Changes' with 0d0a at the end which is apparently for a newline character but again Beyond Compare doesn't show this as a difference in Text Compare (I've seen Git GUi show it as a difference in the past).

How can I get Beyond Compare to ignore changes like these that don't show up in the Text Compare when it considers a particular file as a 'pending change' so I don't see it in the 'Pending Changes' window in the first place?

OR, if that's not at all possible,

How can I get Beyond Compare to show these changes in the default text compare so I can undo them easily?

Ash
  • 5,441
  • 5
  • 15
  • 36
  • 2
    The EF-BB-BF at the start of the file means UTF-8 with BOM. On the right hand side of the top image, above the file contents, you can see the "BOM" underlined in red. – AdrianHHH Apr 28 '16 at 07:55
  • Thank you Adrian. Missed the underlined BOM text; I could use this along with Chris Kennedy's answer below to (somewhat) resolve this. – Ash Apr 29 '16 at 01:48

1 Answers1

2

To make the extra newline character show as a difference in the Text Compare:

  1. Click the Rules toolbar button (referee icon).
  2. In the Importance tab, check Compare line endings (PC/Mac/Unix).
  3. To make it the default for new Text Compare sessions, change the dropdown from Use for this view only to Also update session defaults before you click OK.

If you turn on View > Visible Whitespace, the extra newline character will show as a red difference. When this setting is on, it will also show Windows style newline on one side and Unix style newline on the other side as a difference.

As AdrianHHH said, the EF BB BF is a UTF-8 byte order mark. It isn't possible to add or remove a BOM in the Text Compare. In the Hex Compare, it is possible to delete the BOM from a file.

Chris Kennedy
  • 2,101
  • 9
  • 8