Did someone actually test any of the new C11 features? This was the main point of the original release candidate, you know...
/Pelle
J just started playing around with some of the C11 unicode additions. The following code fails to compile on Win XP Pro SP3, 32-bits, resulting in a
fatal error #1065: Failed converting input using codepage 65001 error...
#include <stdlib.h>
#include <stdio.h>
//#include <uchar.h>
#define pressENTER() \
do{ \
char mYcHAr; \
printf( u8"πατήστε ENTER..." ); \
while ( (mYcHAr=getchar()) != '\n' && mYcHAr != EOF ) \
; \
}while(0)
/*****************************************/
int main( void )
{
#if defined(__STDC_UTF_16__)
puts( "utf16 enabled" );
#endif
#if defined(__STDC_UTF_32__)
puts( "utf32 enabled" );
#endif
char u8str[] = u8"αβγδ"; // this is "abcd" in Greek
printf( "%s\n", u8str );
pressENTER();
exit(0);
}
Project options:
CCFLAGS: -std:C11 -Tx86-coff -Ot -Ob1 -fp:precise -W1 -Gd
ASFLAGS: -AIA32 -Gd
LINKFLAGS: -subsystem:console -machine:x86 kernel32.lib advapi32.lib delayimp.lib
The source file encoding doesn't seem to make any difference (I tried saving it in all available encodings).
FYI, it did compile with mingw32-gcc-4.7.0 (which btw seems to provides partial C11 support, missing lots of header files, uchar.h included). On the utf-8 aware
mintty console it produces the following output...
However, on the native cmd.exe switched to cp 65001 (this a handicapped UTF-8 codepage) it doesn't output the greek characters...
Switching cmd.exe to cp 1253 (the "good" Greek ANSI codepage) it outputs the Greek characters, but scrambled as expected.
PS. Tomorrow I will also test it on Win7 Home 64-bit and I'll let you guys know.