WINDOWS:VS(エラーC2001:改行が一定)



Windows Vs Error C2001



参照:https://www.cnblogs.com/kuliuheng/archive/2013/10/30/3397796.html

(1)中国語の代わりに英語のコードを使用する



(2)末尾に偶数の中国語または英語の記号(「。」など)。

(3)ファイルエンコーディングをUTF-8形式に手動(メモ帳など)で変換します。



問題の詳細な原​​因については、ネチズンの分析の説明を参照してください(引用: http://www.cnblogs.com/cocos2d-x/archive/2012/02/26/2368873.html ):

A person named wva encountered a similar problem, he submitted this bug to Microsoft http://connect.microsoft.com/VisualStudio/feedback/details/341454/compile-error-with-source-file-containing-utf8-strings-in-cjk-system-locale According to the explanation of the Visual C++ Compiler Team staff: The compiler when faced with a source file that does not have a BOM the compiler reads ahead a certain distance into the file to see if it can detect any Unicode characters - it specifically looks for UTF-16 and UTF-16BE - if it doesn't find either then it assumes that it has MBCS. I suspect that in this case that in this case it falls back to MBCS and this is what is causing the problem. As you can see, it is like this for those file designs without BOM. In terms of tone, their compiler team does not plan to modify the design. So, if you use 'unsigned UTF-8' encoded files on VC, you are playing with an untimely bomb. Because you are never sure which words will pass the compilation and which will not! If you want to hard code a string, even character encoding conversion may not help you. Once you increase the character encoding conversion code for this, it also means that portability is reduced. Because this is fundamentally determined by the compiler.