On my system, outputting a character constant such as 'ä' or 'ö' to screen will result in an incorrect character being output (or an incorrect decimal value if %d is used in printf). Output of the character constants to disc file will result in a correct character output but an incorrect decimal output.

Incorrect output also results when such characters are read from a disk file to an integer variable and that variable is then output as a decimal value or as a character. However, if the characters are read in from the keyboard to a variable they are interpreted correctly.


The problem happens with both Code::Blocks and VC++ 2008 (English-language software on a non-English-language system).

Any suggestions?