Git on windows : weird character on first line for C# file
Using http://code.google.com/p/msysgit/downloads/detail?name=Git-1.7.3.1-preview20101002.exe&can=2&q= GUI when v开发者_开发问答iewing a c# file I get this:
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
Is + normal characters?

is what the unicode character U+FEFF encoded as UTF-8 looks like when you "assume" the encoding is actually ISO-8859-1 (Latin 1).
U+FEFF is zero-width non-breaking space but this usage is deprecated and is normally used as a byte-order mark (BOM) in character encoding schemes which have multibyte code units as the byte swapped version: U+FFFE is not a valid unicode character.
As UTF-8 is just a sequence of bytes it makes no sense to have a byte order mark but some tools still use the character as a UTF-8 "signature".
It is the Unicode byte order mark. So the software that is showing you the text is displaying the BOM instead of skipping it.
Theses characters are the BOM (Byte Order Mark) of the encoded file.
UTF-8 files can be encoded with or without BOM. You can do the conversion with tools like "Notepad++".
精彩评论