Hello all,
I'm trying to compile a mingw version of a program that outputs some non-ascii characters (iso-latin1).  I'm using gcc under cygwin.  When I use the mingw libraries, the program outputs using the DOS codepage 437 (http://www.kostis.net/charsets/cp437.htm) (it's the one with the little ascii-art lines), when I compile using the cygwin libraries, I get DOS codepage 1252 (http://www.kostis.net/charsets/cp1252.htm) (similar to iso-latin1), which is what I want.  Is there a compiler option, or an environment variable, or a library I can include to tell gcc what encoding to use by default in calls to printf()?  
The bizarre thing is that under both DOS and cygwin bash shell, the output of the -mno-cygwin compiled program is CP437, but if I save it to a file and cat it back out, it's interpreted as iso-latin1.  This means that even though I get the wrong output from my program, I can't prove it to anyone, because when I cut and paste the output, or view it in an editor, it looks like the characters I want!  I found this out while trying to include the output of the following code in this email. 
I started to try including the libiconv routines, but it seems there should be a simpler solution.
Any help will be appreciated!
Here is a minimal test case:
#include <stdio.h>
#include <stdlib.h>
int main(void){
  int i; 
  for (i = 224; i< 256; i++) {            // 224-256 is the "region of interest"
    printf("%3d (%2X): %c  ",i, i, i);  // print i in decimal, (hex), and ascii
    if ((i+1) % 4 == 0) printf("\n");
  return 0;
$ cpp -o cygtext asciitest.c
$ ./cygtext
224 (E0):   225 (E1):   226 (E2):   227 (E3):  
228 (E4):   229 (E5):   230 (E6):   231 (E7):  
232 (E8):   233 (E9):   234 (EA):   235 (EB):  
236 (EC):   237 (ED):   238 (EE):   239 (EF):  
240 (F0):   241 (F1):   242 (F2):   243 (F3):  
244 (F4):   245 (F5):   246 (F6):   247 (F7):  
248 (F8):   249 (F9):   250 (FA):   251 (FB):  
252 (FC):   253 (FD):   254 (FE):   255 (FF):  
(you should see iso-latin-1 above, this is what I want)
$ cpp -mno-cygwin -o mingwtext asciitest.c
$ ./mingwtext
. . . output is different from the above . . .
(but when I paste it into this email it looks like the above!! )