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.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.