orcmid
Well, you know, it is a warning. I don't think VC++ 2005 Express Edition has any way to tell that you are using Latin1. I think that is why it checks the default code page you are running under.
There's probably a #pragma clause that you could add to your #if material to suppress that particular warning.
I think we are seeing the difficulties of moving to Unicode while our systems don't support Unicode at the codepage and console application level and it is not possible to tell which non-Unicode format is being used on a computer except by checking the default code page setting. Sometimes, the programmer has to guess wrong in attempting to have a behavior that works most of the time.
- Dennis
MORE ANALYSIS:
Because the Forum web page is in UTF-8, I was able to paste your program into a blank C Language file using VC++ 2005 Express Edition on my code-page 437 configuration. I see the pound-Sterling symbol without any trouble, and I don't see any warning when I compile. But the program shows me a single "u" symbol when I compile it and run it in a console window. This is exactly what I deserve for character code 0xA3, of course, because that's what code-page 437 has to offer (its code for the pound-Sterling symbol being 0x9C).
So what do you see in your program's output when you compile and run it with VC++ under default codepage 936 Surely not '¡ê'
This article digs into some of the same problems you are reporting: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=306497&SiteID=1
I think one of the reasons for the warning is that the character literal '¡ê' (with 0xA3 followed by 0x27) is not a valid code-page 936 sequence and creating '¡ê' == 0xA1EA is apparently too over the edge (and won't produce the desired result anyhow), so it creates 0xFFFFFFA3 instead and then printf uses only the low-order byte.
I don't think the ' ' comes from the compiler. It comes from the run-time system when it doesn't recognize a code for the code-page you have installed. (I ran into all of this fussing with codepage 932 recently.)
The message is misleading. The advice about saving the file (that is, your test.c file) in Unicode format (UTF-8) is fine, but not so easy to do. You can use notepad to do it, and if the file is pasted into a blank page the way I did with your sample, it appears that the file is indeed saved in UTF-8 (the pound-Sterling symbol saves and restores just fine). The compiler can't tell you are using Latin1 because there are no markers that indicate the intended code as there are for UTF-8 and UTF-16 files on Windows.