Web lists-archives.com

[Mingw-users] using mblen in windows

I have set my system locale to Korean in windows.
and in test program

void main()
    setlocale(LC_ALL, "korean");

    char *b = "한";
    mblen(NULL, MB_CUR_MAX);
    printf("%d\n", mblen(b, MB_CUR_MAX));
    printf("%d\n", strlen(b));       

C:\WINDOWS\system32\cmd.exe /c ( ^"mbstrlentest^" )
shell returned 2
Hit any key to close this window...

mblen seems to return incorrect multibyte length.  if I set locale to Korean, is it even a multibyte coding? strlen says 3 bytes, so I assume it's multibyte.
MinGW-users mailing list

This list observes the Etiquette found at 
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

You may change your MinGW Account Options or unsubscribe at:
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe