summaryrefslogtreecommitdiff
path: root/src/ctype/iswprint.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ctype/iswprint.c')
-rw-r--r--src/ctype/iswprint.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ctype/iswprint.c b/src/ctype/iswprint.c
new file mode 100644
index 00000000..7717671a
--- /dev/null
+++ b/src/ctype/iswprint.c
@@ -0,0 +1,10 @@
+#include <wctype.h>
+
+int iswprint(wint_t wc)
+{
+ unsigned c = wc;
+ /* assume any non-control, non-illegal codepoint is printable */
+ if (c>0x10ffff || c-0xd800<0x800 || (c&0xfffe)==0xfffe || iswcntrl(c))
+ return 0;
+ return 1;
+}