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.