Visual Studio: 使用简体中文(GB2312)编码加载文件, 有些字节已用Unicode替换字符更换

标签:
visualstudio2010unicodereplaced |
分类: Devops.Container.Tool |
遭遇下列VS2010错误: Some bytes have been replaced with the Unicode substitution character while loading file base64.cpp with Chinese Simplified (GB2312) encoding. Saving the file will not preserve the original file contents.
http://s14/mw690/0026uWfMgy6Y9r5a4DH8d&690Studio:我的Visual Studio已经勾选了Auto-detect UTF-8 encoding without signature:
http://s4/mw690/0026uWfMgy6Y9t5TUht53&690Studio:
Ultraedit不能正常显示base64.cpp,但Sublime Text能正常显示。
http://s11/mw690/0026uWfMgy6Y9rPZfRM6a&690Studio:原因是base64.cpp并不是UTF-8编码,但是包含一个十六进制为"E9"的字符,即带重音符的e。由于我的系统locale是RPC,所以显示不正常,估计系统locale改成CP1252 - Windows 拉丁语1代码页就可以了。
用Sublime Text将其转存为UTF-8编码当然也可以。