Index: libutil/char.c
===================================================================
RCS file: /sources/global/global/libutil/char.c,v
retrieving revision 1.15
diff -u -p -r1.15 char.c
--- libutil/char.c	5 Jul 2007 06:52:02 -0000	1.15
+++ libutil/char.c	21 Nov 2009 09:57:49 -0000
@@ -25,6 +25,7 @@
 #include "char.h"
 #include "strbuf.h"
 
+#define B	BINARYCHAR
 #define R	REGEXCHAR
 #define U	URLCHAR
 #define RU	REGEXCHAR | URLCHAR
@@ -32,8 +33,8 @@ const unsigned char chartype[256] = {
 #if '\n' == 0x0a && ' ' == 0x20 && '0' == 0x30 \
   && 'A' == 0x41 && 'a' == 0x61 && '!' == 0x21
 	/* ASCII */
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+	B, B, B, B, B, B, B, B, B, 0, 0, 0, 0, 0, B, B,
+	B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B,
 	0, U, 0, 0, R, 0, 0, U,RU,RU,RU, R, 0, U,RU, U,	/*  !"#$%&'()*+,-./ */
 	U, U, U, U, U, U, U, U, U, U, 0, 0, 0, 0, 0, R,	/* 0123456789:;<=>? */
 	0, U, U, U, U, U, U, U, U, U, U, U, U, U, U, U,	/* @ABCDEFGHIJKLMNO */
Index: libutil/char.h
===================================================================
RCS file: /sources/global/global/libutil/char.h,v
retrieving revision 1.8
diff -u -p -r1.8 char.h
--- libutil/char.h	5 Jul 2007 06:52:02 -0000	1.8
+++ libutil/char.h	21 Nov 2009 09:57:49 -0000
@@ -24,6 +24,7 @@ extern const unsigned char chartype[256]
 
 #define REGEXCHAR		1
 #define URLCHAR			2
+#define BINARYCHAR		4
 #define test_chartype(c, t)	(chartype[(unsigned char)(c)] & (t))
 
 /* test whether or not regular expression char. */
@@ -32,6 +33,9 @@ extern const unsigned char chartype[256]
 /* test whether can be included in URL without escaping. */
 #define isurlchar(c)		test_chartype(c, URLCHAR)
 
+/* test whether or not cahr included in binary file. */
+#define isbinarychar(c)		test_chartype(c, BINARYCHAR)
+
 int isregex(const char *);
 const char *quote_string(const char *);
 
Index: libutil/test.c
===================================================================
RCS file: /sources/global/global/libutil/test.c,v
retrieving revision 1.15
diff -u -p -r1.15 test.c
--- libutil/test.c	19 Jul 2007 14:08:22 -0000	1.15
+++ libutil/test.c	21 Nov 2009 09:57:49 -0000
@@ -38,6 +38,7 @@
 #endif
 
 #include "locatestring.h"
+#include "char.h"
 #include "die.h"
 #include "test.h"
 
@@ -65,7 +66,7 @@ is_binary(const char *path)
 		return 1;
 	for (i = 0; i < size; i++) {
 		c = (unsigned char)buf[i];
-		if (c == 0 || c > 127)
+		if (isbinarychar(c))
 			return 1;
 	}
 	return 0;
