Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Red dot marker BitBucket diff view

We recently migrated our sources from SVN and TFVC to Git. Our code base is mainly constitued of C# and VB.NET files edited in VS2017.

Our Git repos are hosted in BitBucket, but we have an issue with diffs, as you can see bellow, BitBucket displays a small red dot at the begining of our files

enter image description here

On hover, \ufeff is shown in a tooltip, and I know it is a character denoting a zero width non-breaking space (ZWNBSP).

On a personnal side, I host all my source code on GitHub and never had an issue similar to this.

So, what do we risk if we leave this as is ? Which other options do we have ?

Thanks in advance for your help, Roxtar

like image 820
Selmir Avatar asked Aug 31 '18 17:08

Selmir


2 Answers

I had red dots in diffs in bitbucket on xml files coming from VS2017 project.

Red dot represents the Unicode code point U+FEFF (\ufeff) Byte Order Mark (BOM). In my case when I edited a xml UTF-8 file in Visual Studio it added BOM sequence to the beginning of the file.

It is possible to remove BOM (red dot) by resaving a file in Visual Studio without signature. Open file in VS (2017) then File -> Save As. On Save button there is a drop down option 'Save with Encoding'

It defaults to 'Unicode (UTF-8 with signature)'. Change to 'Unicode (UTF-8 without signature')

git diff will see the removal of \ufeff

like image 143
frmbelz Avatar answered Sep 18 '22 11:09

frmbelz


your file is encoding in UTF-8-BOM open your file with notepad++, change encoding to encode in UTF-8. encode in UTF-8

like image 24
Mitra Fernando Avatar answered Sep 16 '22 11:09

Mitra Fernando