Hi,

I am having a strange problem with a program compiled with mingw/gcc under
windows environment. Please look at the following "C"  code snippet...

wordlist.txt contains UTF-8 Tamil text.

if ((fileHandle = _wfopen( L"wordlist.txt",L"rt,ccs=UTF-8")) != NULL)
{
    wchar_t c;
    for(a=0;a<5;a++)
    {
        c = fgetwc(fileHandle);
        printf("%04X %d\n",c,sizeof(wchar_t));
    }
}

It is working perfectly in Windows Vista. That is, it produces an output
like
0B85 2
0B83 2
0BB1 2
0BBF 2
0BA3 2


But in Windows XP, it produces an unexpected output like
00EF 2
00BB 2
00BF 2
00E0 2
00AE 2

What could be the problem? The first three values listed (in xp) are
actually UTF-8 markers.

Regards,
Arun Venkataswamy
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc

Reply via email to