從别處拷貝一段代碼到程式運作,出現一堆的警告:
warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss。
這個警告提示反正就是和 Unicode 字元有關,具體是哪行也不好找。
網上推薦的方法大多是忽略,還有幾個試過不行。後來找到這個很管用。
方法如下:
- 打開出現 warning 的檔案,Ctrl+A全選,
- 然後在檔案菜單:
file->Advanced save options
- 在彈出的選項中選擇新的編碼方式為:
UNICODE- codepage 1200
warning C4819的解決辦法 - 點确定後編譯
搞定。