Per POSIX [1], the functions strcasecmp and strncasecmp should "use the current locale to determine the case of the characters.".
[1] https://pubs.opengroup.org/onlinepubs/9799919799/functions/strcasecmp.html This is not what Cygwin does: In the fr_FR.ISO8859-1 locale, the characters 0xE9 and 0xC9 are the same modulo case, but strcasecmp and strncasecmp consider these characters to be different. How to reproduce (in Cygwin 2.9.0 or 3.5.6): ============================= foo.c ========================== #include <stdio.h> #include <ctype.h> #include <locale.h> #include <strings.h> int main () { if (setlocale (LC_ALL, "fr_FR.ISO8859-1") == NULL) return 1; int c1 = (unsigned char) '\311'; int c2 = (unsigned char) '\351'; printf ("0x%02X -> 0x%02X, 0x%02X\n", c1, tolower (c1), toupper (c1)); printf ("0x%02X -> 0x%02X, 0x%02X\n", c2, tolower (c2), toupper (c2)); printf ("strcasecmp -> %d\n", strcasecmp ("Fej\311r", "Fej\351r")); printf ("strncasecmp -> %d\n", strncasecmp ("Fej\311r", "Fej\351r", 5)); } ======================================================================= $ gcc -Wall foo.c $ ./a Expected output: 0xC9 -> 0xE9, 0xC9 0xE9 -> 0xE9, 0xC9 strcasecmp -> 0 strncasecmp -> 0 Actual output: 0xC9 -> 0xE9, 0xC9 0xE9 -> 0xE9, 0xC9 strcasecmp -> 256 strncasecmp -> 256 Bruno -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple