




You can also figure out which one you have with GetConsoleOutputCP (the input is controlled differently, through SetConsoleCP)ĥ is a funny one. It should default to your default system codepage. Except for control codes, << just passes the data down for char *.Ĥ is controlled by SetConsoleOutputCP. I have failed to find explicit details/control on this.ģ is even easier. It generates the string literal corresponding data chunk in the current codepage no matter what the source encoding was. It looks like the compiler guesses what format the source file is in, and decodes it to its internal representation. how the console translates that output to a font glyph.ġ and 2 are fairly easy ones.how your What your compiler does with a string literal, and what source encoding it understands.how your C++ file will be seen by the compiler) What encoding your source file is in (i.e.So the issue is not one of UTF8 encoding, as it would combine multiple source chars to less glyphs.įrom you source string to the display on the console, all those things play a part: To start with, you have 4 chars on your cout line, and 4 glyphs on the output. Everything below is about a specific implementation (as it happens, VC2008 on a US locale machine). It ain't much in there, and all the characters used are in ascii. The specification states in 2.2 what character sets are valid in source code. Before I go any further, I should mention that what you are doing is not c/c++ compliant.
