As per zephyr discussion, casting to unsigned char may be more correct than casting to signed int, given platforms where char defaults to signed in combination with non-ascii characters. Also, changing the type of the variable passed to the ctype.h macros may be more appropriate in some of the cases.