about summary refs log tree commit diff
path: root/wcsmbs/wctob.c
diff options
context:
space:
mode:
Diffstat (limited to 'wcsmbs/wctob.c')
-rw-r--r--wcsmbs/wctob.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/wcsmbs/wctob.c b/wcsmbs/wctob.c
index c27bd6baba..f541a2e97b 100644
--- a/wcsmbs/wctob.c
+++ b/wcsmbs/wctob.c
@@ -21,14 +21,11 @@ Boston, MA 02111-1307, USA.  */
 #include <wchar.h>
 
 
+/* We use UTF8 encoding for multibyte strings and therefore a valid
+   one byte multibyte string only can have a value from 0 to 0x7f.  */
 int
 wctob (c)
      wint_t c;
 {
-  /*************************************************************\
-  |* This is no complete implementation.  While the multi-byte *|
-  |* character handling is not finished this will do.	       *|
-  \*************************************************************/
-
-  return (c & ~0xff) == 0 ? c : EOF;
+  return (c >= 0 && c <= 0x7f) ? c : EOF;
 }