C + + cout, wcout, printf, wprintf do not display Chinese characters or encounter Chinese characters that interrupt the display of the reason

Source: Internet
Author: User
Tags locale

Cause: Machine local cause, cout output, it does not know your output character encoding is what the language, so will be determined according to your computer's regional settings, but my computer is set in English, so the character encoding in accordance with the English processing, it is very obvious that will not show up soon, Because cout found that this is not English at all, do not know what the thing.

If your computer is already set up in the Chinese region, there will be no such problem.

The key is wcout why can not output Chinese, its processing is not utf-16 it? Do you want to divide the computer locale, not the globalization code? The reason is very simple, utf-16 has a proxy page, or with your computer-related


Wcout output is not displayed in Chinese, plus the following sentence on the line.

Std::wcout.imbue (Std::locale ("CHS"));


Primary language

Sublanguage

Language string

Chinese

Chinese

"Chinese"

Chinese

Chinese (Simplified)

"Chinese-simplified" or "CHS"

Chinese

Chinese (Traditional)

"Chinese-traditional" or "CHT"

Czech

Czech

"Csy" or "Czech"

Danish

Danish

"Dan" or "Danish"

Dutch

Dutch (default)

"Dutch" or "NLD"

Dutch

Dutch (Belgium)

"Belgian", "Dutch-belgian", or "NLB"

中文版

中文版 (default)

"中文版"

中文版

中文版 (Australia)

"Australian", "Ena", or "English-aus"

中文版

中文版 (Canada)

"Canadian", "enc", or "English-can"

中文版

中文版 (New Zealand)

"English-nz" or "Enz"

中文版

中文版 (Kingdom)

"Eng", "English-uk", or "UK"

中文版

中文版 (states)

"American", "American 中文版", "American-english", "English-american", "english-us", "English-usa", "enu", "us", or " usa

Finnish

Finnish

"Fin" or "Finnish"

French

French (default)

"Fra" or "French"

French

French (Belgium)

"FRB" or "French-belgian"

French

French (Canada)

"FRC" or "French-Canadian"

French

French (Switzerland)

"French-swiss" or "FRS"

German

German (default)

"Deu" or "German"

German

German (Austria)

"DEA" or "German-austrian"

German

German (Switzerland)

"Des", "German-swiss", or "Swiss"

Greek

Greek

"Ell" or "Greek"

Hungarian

Hungarian

"Hun" or "Hungarian"

Icelandic

Icelandic

"Icelandic" or "ISL"

Italian

Italian (default)

"Ita" or "Italian"

Italian

Italian (Switzerland)

"Italian-swiss" or "its"

Japanese

Japanese

"Japanese" or "JPN"

Korean

Korean

"KOR" or "Korean"

Norwegian

Norwegian (default)

"Norwegian"

Norwegian

Norwegian (Bokmal)

"Nor" or "norwegian-bokmal"

Norwegian

Norwegian (Nynorsk)

"Non" or "Norwegian-nynorsk"

Polish

Polish

"Plk" or "Polish"

Portuguese

Portuguese (default)

"Portuguese" or "PTG"

Portuguese

Portuguese (Brazil)

"Portuguese-brazilian" or "PTB"

Russian

Russian (default)

"Rus" or "Russian"

Slovak

Slovak

"Sky" or "Slovak"

Spanish

Spanish (default)

"ESP" or "Spanish"

Spanish

Spanish (Mexico)

"ESM" or "Spanish-mexican"

Spanish

Spanish (modern)

"ESN" or "Spanish-modern"

Swedish

Swedish

"Sve" or "Swedish"

Turkish

Turkish

"TRK" or "Turkish"


C + + cout, wcout, printf, wprintf do not display Chinese characters or encounter Chinese characters that interrupt the display of the reason

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.