1 2 3 4 5 6
#include <ctype.h> int isprint(int x) { unsigned char c=x&0xff; return (c>=32 && c<=126) || (c>=160 && c<=255); }