visual-studio-2008 - 这些文件的字符编码在 TFS 中不同

标签 visual-studio-2008 tfs

上次 checkin 的文件与旧文件之间存在编码错误。我怎么知道旧的检查编码类型。

我在 Visiul studio 2008 中使用 UTF-8(带签名)。我可以在 IDE 文件 -> 高级保存选项中保存编码。某些 vs2008 在文件选项卡中不显示“高级保存选项”。如何在文件中显示“高级保存选项”?

最佳答案

在 VS 中,您可以浏览到源代码管理资源管理器中的文件,右键单击它并选择“属性”

在 Visual Studio 命令提示符中,您可以键入:tf properties $/path/to/file.csFile 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/

相关文章:

c++ - 列出 cmake 生成的 Visual Studio C++ 项目中的头文件

visual-studio - 删除挂起的更改,但不要“T 'UNDO' 我从 TFS 进行的更改

html - vs2008 可以禁用自动格式化吗?

c# - 是真 :TrueCondition:FalseCondition Evaluates Both Conditions

c# - Microsoft.CSharp.Core.targets 缺失

tfs - 在一个项目中创建一个分支,其父级在 TFS 中的另一个项目下

git - 如何从 VSTS 获取 Git 统计信息

c# - TFS API - 如何从特定团队项目中获取工作项

c++ - 使用 VC++ 2008 编译引用 STLport-5.1.4 的应用程序时出现 LNK2001 错误

c# - 确定接口(interface)/类中方法数量的快速方法