This is the response I got:
Quote:
Assuming the use of an 8-bit clean compression routine internally (in option.h), then having the right locale set in LANG should cause the LC_CTYPE locale to be set correctly and 8-bit chars will be considered printable by the ctype.h macros.
Now, looking in ctype.h I see this:
#define _U 01
#define _L 02
#define _N 04
#define _S 010
#define _P 020
#define _C 040
#define _X 0100
#define _B 0200
extern __IMPORT _CONST char _ctype_[];
#define isalpha(c) ((_ctype_+1)[(unsigned)(c)]&(_U|_L))
#define isupper(c) ((_ctype_+1)[(unsigned)(c)]&_U)
#define islower(c) ((_ctype_+1)[(unsigned)(c)]&_L)
#define isdigit(c) ((_ctype_+1)[(unsigned)(c)]&_N)
#define isxdigit(c) ((_ctype_+1)[(unsigned)(c)]&(_X|_N))
#define isspace(c) ((_ctype_+1)[(unsigned)(c)]&_S)
#define ispunct(c) ((_ctype_+1)[(unsigned)(c)]&_P)
#define isalnum(c) ((_ctype_+1)[(unsigned)(c)]&(_U|_L|_N))
#define isprint(c) ((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N|_B))
#define isgraph(c) ((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N))
#define iscntrl(c) ((_ctype_+1)[(unsigned)(c)]&_C)
How this works basically is that there is an array of 256 bytes (_ctype_) and to test if a given character is (say) alpha, the isalpha macro indexes into that array and sees if the bits _U or _L are set (Upper or Lower I presume).
I can't see where this array itself is defined, so it is probably inside a library somewhere. So it appears that by correctly localising (something I don't know how to do), the correct library will be installed, the correct _ctype_ array will be used, and your characters will automatically work. :)
|