************************************************** Print single- or multi-byte character **************************************************/static int print_char_old(FILE *f, uschar *ptr, BOOL utf8){ int c = *ptr; if (!utf8 || (c & 0xc0) != 0xc0) { if (isprint(c)) printf("%c", c); else printf("\\x%02x", c); return 0; } else { int i; int a = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */ int s = 6*a; c = (c & _pcre_utf8_table3[a]) << s; for (i = 1; i <= a; i++) { /* This is a check for malformed UTF-8; it should only occur if the sanity check has been turned off. Rather than swallow random bytes, just stop if we hit a bad one. Print it with \X instead of \x as an indication. */ if ((ptr[i] & 0xc0) != 0x80) { printf("\\X{%x}", c); return i - 1; } /* The byte is OK */ s -= 6; c |= (ptr[i] & 0x3f) << s; } if (c < 128) printf("\\x%02x", c); else printf("\\x{%x}", c); return a; }}