Re: git adds some text file as binary file by mistake
From: Robin Rosenberg <hidden>
Date: 2016-06-15 22:45:33
torsdagen den 30 oktober 2008 07.32.47 skrev Ping Yin:
On Fri, Oct 24, 2008 at 9:30 PM, Ping Yin [off-list ref] wrote:quoted
On Fri, Oct 24, 2008 at 8:54 PM, Michael J Gruber [off-list ref] wrote:quoted
Ping Yin venit, vidit, dixit 24.10.2008 14:37:quoted
So what should i do if i want it added as text file?You should give us more detail on the file ;) What's the extension, what's the typical content? It may be a simple matter of specifying attributes. Do ordinary diff and grep recognize your files as text? MichaelIt's just an xml file. I guess maybe there are some hidden characters at the beginning. I will figure it out later because i have no access to that file right now. Ping YinI have figured it out. It's just because the BOM characters feff00 in the beginning of the utf-8 xml file.
The UTF-8 BOM is EF BB BF, (no NUL.). FEFF is UTF-16 BE (and the third byte would be 00 for an XML file). I think git currently regards just about any UTF-16 file as binary becuase of the NUL bytes. -- robin