1 /*
2 Copyright (c) 2016 Corinna Vinschen <corinna@vinschen.de>
3 Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling
4  */
5 /* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */
6 #include <_ansi.h>
7 #include <ctype.h>
8 #include <wctype.h>
9 #include "local.h"
10 #include "categories.h"
11 
12 int
iswlower_l(wint_t c,struct __locale_t * locale)13 iswlower_l (wint_t c, struct __locale_t *locale)
14 {
15   (void) locale;
16 #ifdef _MB_CAPABLE
17   c = _jp2uc_l (c, locale);
18   // The wide-character class "lower" contains at least those characters wc
19   // which are equal to towlower(wc) and different from towupper(wc).
20   enum category cat = category (c);
21   return cat == CAT_Ll || (cat == CAT_LC && towlower (c) == c);
22 #else
23   return c < 0x100 ? islower (c) : 0;
24 #endif /* _MB_CAPABLE */
25 }
26