English environment output Chinese [chcp 936 invalid page solution]

Source: Internet
Author: User

In the beginning, vs2010 beta2 cannot output Chinese characters. The simplest code is as follows:

 

# Include <stdio. h>
Int main ()
{
Printf ("Chinese character ");
Return 0;
}

 

The error message is:

 

Warning c4566: character represented by universal-character-name '/u6c49' cannot be represented in the current Code Page (1252)

Warning c4566: character represented by universal-character-name '/u5b57' cannot be represented in the current Code Page (1252)

 

At the beginning, I was constantly modifying the encoding method of the output stream. I couldn't do any of the methods on the Internet. I finally got a prompt on the csdn forum, which may be a problem with codePage,

I entered chcp in cmd.exe. The Code 437 is the code page of the United States. However, when chcp 936 is entered, the system prompts that the code page is invalid. I went to the Registry and checked it, the database-> codePage has a 936 subkey. Why?

Because the system is in English and the system locale is also in us, the default codePage is 437.

But after I change my system locale to Chinese (PRC), restart and the default codePage will be 936.

When I entered the English system locale and entered chcp 936 to display the invalid code page, the problem still failed to be solved. It was strange that I found it clearly!

 

Function of system locale: This setting (system locale) controls the lanusge used when displaying text in programs that do not support Unicode.

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.