I don't claim to know anything about either C or the DGD source, but it seems to me that by changing the bitmask in that way you make the check, that checks for illegal characters, more general. This is what my same line looks like to allow ANSI. } else if ((*p & 0x7f) < ' ' && *p != HT && *p != BEL && *p != BS && *p != '\033') { Regards, Jimorie