Default encoding for Visual studio new source files

Source: Internet
Author: User

Original vs New source file The default encoding is selected according to the system locale. My is GB 2312. I'm the grass. But I'm dead. Have not known.

It was mainly necessary to use Doxygen to generate HTML documents, the default input file format is UTF-8, is not with the BOM. I use notepad++ all to convert the source file into UTF-8 with the BOM encoding format. Then I opened the project again with VS, and the results were compiled.

Warning C4819: The file contains characters that cannot be represented in the current code page (936). Please save the file in Unicode format to prevent data loss

And reported a strange mistake about it. The reason is that there are non-visible characters in the file. (BOM header).

Analyze the following process:

Originally the original source file is not with the BOM header.

It was later converted to notepad++ with a BOM head. is the UTF-8 encoding format on the notepad++ (it is with the BOM by default)

Later did not turn back, using a BOM, VS's current code page is not with the BOM. So just say there are characters that are not visible. So I compiled an error.

So. Click the Select File, select the Advanced save option for the file in the VS menu bar, and select the UTF-8 signed code page.

References

http://blog.csdn.net/enjoy517905407/article/details/37958035

Default encoding for Visual studio new source files

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.