Assume an ASCII compatible wide character encoding.
authorBruno Haible <bruno@clisp.org>
Fri, 28 Jul 2006 15:31:45 +0000 (15:31 +0000)
committerBruno Haible <bruno@clisp.org>
Fri, 28 Jul 2006 15:31:45 +0000 (15:31 +0000)
lib/mbswidth.c
lib/wcwidth.h

index 48da6639dc112e683eeba4b546caf0241609cff5..072695172b5f33376f7cc42ca804a5cc1d286483 100644 (file)
@@ -51,7 +51,7 @@
 # include <wctype.h>
 #endif
 #if !defined iswcntrl && !HAVE_ISWCNTRL
-# define iswcntrl(wc) 0
+# define iswcntrl(wc) (((wc) & ~0x1f) == 0 || (wc) == 0x7f)
 #endif
 
 #ifndef mbsinit
index 9af75e0a775841d38a455f232a5bd0429fa8d2bb..1c95d0e11b562901469ceaf6635f6b62aac2ce06 100644 (file)
 #  include <wctype.h>
 # endif
 # if !defined iswprint && !HAVE_ISWPRINT
-#  define iswprint(wc) 1
+ststic inline int
+iswprint (wint_t wc)
+{
+  return (wc >= 0 && wc < 128
+         ? wc >= ' ' && wc <= '~'
+         : 1);
+}
 # endif
 
 # ifndef HAVE_DECL_WCWIDTH