Recovery of Chinese garbled characters due to chaotic Coding

Source: Internet
Author: User

In the development of VC ++,Source codeThe file is saved as gb2312 encoding by default.

If it is switched to an English environment, it will be opened using the "Western European" encoding, and the "Chinese Character comments" in the file will be garbled. This is of course not a problem. The key is whenCodeToo many Chinese characters, so that we do not notice any garbled characters in the file, and then enter new Chinese characters will be chaotic. Because, when saving, the editor will prompt you to use Unicode-related encoding for saving. If you choose to save it with a UTF-8, congratulations, the new Chinese and old Chinese in this file have been smoothly confused.

Recovery Solution: Create a TXT file, set to UTF-8 encoding, copy the old chaotic Chinese characters in the source code, and then save as "Western European" encoding, then, use gb2312 to open the TXT file and you will see the long-overdue comments.

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.