上次 checkin 的文件与旧文件之间存在编码错误。我怎么知道旧的检查编码类型。
我在 Visiul studio 2008 中使用 UTF-8(带签名)。我可以在 IDE 文件 -> 高级保存选项中保存编码。某些 vs2008 在文件选项卡中不显示“高级保存选项”。如何在文件中显示“高级保存选项”?
最佳答案
在 VS 中,您可以浏览到源代码管理资源管理器中的文件,右键单击它并选择“属性”
在 Visual Studio 命令提示符中,您可以键入:tf properties $/path/to/file.cs
,File Type
行会告诉您当前的编码.查看Properties Command on MSDN了解更多信息。
添加新文件时,TFS会自动判断文件编码based upon these rules :
First, a file with a Unicode byte order mark (BOM) is added as that particular type (UTF-8, UTF-16 big endian, UTF-16 little endian, etc.).
If a file doesn't have a BOM, we check for an unprintable ASCII character in the first 1 kilobyte of the file. If there is no unprintable ASCII character in there, the encoding is set to the current code page being used, which is Windows-1252 on US English Windows systems.
If an unprintable character is detected, the file is detected as being binary. The unprintable ASCII characters detected are in the range of 0 - 0x1F and 0x7F excluding 0x9 (TAB), 0xA (LF), 0xC (FF), 0xD (CR), and 0x1A (^Z).
关于visual-studio-2008 - 这些文件的字符编码在 TFS 中不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4519753/