VS2015 warning C4819: The file contains a character can not be represented in the current code page (936) in. Please save the file as Unicode format to prevent data loss

problem:

Visual Studio 2015 appears warning C4819: The file contains a character can not be represented in the current code page (936) in. Please save the file as Unicode format to prevent data loss.

 

Solution:
1. Modify the character encoding format  (recommended)
Visual Studio provides advanced saving options function, it can specify line breaks and end of a line specific coding standard code file being used. In Visual Studio 2015, the default command does not appear in the "File" menu. Users need to manually set to display the command. Operation is as follows:

(1) Click the "Tools" | "custom" command, pop-up "Customize" dialog box.
(2) Click the "command" tab and enter "command" tab.
(3) in the "menu bar" drop-down list, select "File" option.
(4) Click the "Add Command" button to bring up the "Add Command" dialog box.
(5) In the "Category" list, select "File" option; the "order" list, select "Advanced Save Options" option.
(6) Click the "OK" button to close the "Add Command" dialog box.
"Move Up" or "Down" button (7) select the "Controls" list in the "Advanced Save Options", click, adjust the command position.
(8) Click "Close" button, add a command to complete the operation "Advanced Save Options."
(9) to open the "Advanced Save Options" under the "File" menu, set the encoding  Unicode (utf-8 with signature) - code page 65001 

 

2. The shield type warning (not recommended)

Add the appropriate number Disable Specific Warnings Advance warning of> in the Project -> the Properties -> the Configuration the Properties - -> C / C ++: 4819;

3. Warning of a file separate shield (not recommended)

Find out the file does not conform to the Unicode format, and then add the following statement at the beginning of the file:

# pragma warning (disable:4819)

Guess you like

Origin www.cnblogs.com/leokale-zz/p/11423953.html