diff --git a/newlib/libc/ctype/iswupper_l.c b/newlib/libc/ctype/iswupper_l.c
index 2555cd0..7ce8b5e
--- a/newlib/libc/ctype/iswupper_l.c
+++ b/newlib/libc/ctype/iswupper_l.c
@@ -1,10 +1,20 @@
+/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */
#include <_ansi.h>
+#include <ctype.h>
#include <wctype.h>
+#include "local.h"
+#include "categories.h"
int
iswupper_l (wint_t c, struct __locale_t *locale)
{
- /* We're using a locale-independent representation of upper/lower case
- based on Unicode data. Thus, the locale doesn't matter. */
- return towlower (c) != c;
+#ifdef _MB_CAPABLE
+ c = _jp2uc_l (c, locale);
+ // The wide-character class "upper" contains at least those characters wc
+ // which are equal to towupper(wc) and different from towlower(wc).
+ enum category cat = category (c);
+ return cat == CAT_Lu || (cat == CAT_LC && towupper (c) == c);
+#else
+ return c < 0x100 ? islower (c) : 0;
+#endif /* _MB_CAPABLE */
}