/****************************************************************************
- * Copyright (c) 2001-2006,2007 Free Software Foundation, Inc. *
+ * Copyright (c) 2001-2007,2008 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#include <tic.h>
#include <ctype.h>
-MODULE_ID("$Id: visbuf.c,v 1.24 2007/06/02 18:55:10 tom Exp $")
+MODULE_ID("$Id: visbuf.c,v 1.27 2008/07/05 23:19:59 tom Exp $")
#define NormalLen(len) (unsigned) ((len + 1) * 4)
#define WideLen(len) (unsigned) ((len + 1) * 4 * MB_CUR_MAX)
#ifdef TRACE
-#define StringOf(ch) {ch, 0}
static const char d_quote[] = StringOf(D_QUOTE);
static const char l_brace[] = StringOf(L_BRACE);
static const char r_brace[] = StringOf(R_BRACE);
} else if (c == '\033') {
*tp++ = '\\';
*tp++ = 'e';
+ } else if (UChar(c) == 0x7f) {
+ *tp++ = '\\';
+ *tp++ = '^';
+ *tp++ = '?';
} else if (is7bits(c) && iscntrl(UChar(c))) {
*tp++ = '\\';
*tp++ = '^';
char temp[CCHARW_MAX + 80];
int j = wctomb(temp, c), k;
if (j <= 0) {
- sprintf(temp, "\\u%08X", (wint_t) c);
+ sprintf(temp, "\\u%08X", (unsigned) c);
j = strlen(temp);
}
for (k = 0; k < j; ++k) {