M_REDRAW_LINE /* redraw entire line */
};
-/* FIXME: these functions should deal with unprintable characters */
-
static int my_wcwidth (wchar_t wc)
{
- return wcwidth (wc);
+ int n = wcwidth (wc);
+ if (n > 0)
+ return n;
+ if (!(wc & ~0x7f))
+ return 2;
+ if (!(wc & ~0xffff))
+ return 6;
+ return 10;
}
static int my_wcswidth (const wchar_t *s, size_t n)
static int my_addwch (wchar_t wc)
{
- return mutt_addwch (wc);
+ int n = wcwidth (wc);
+ if (n > 0)
+ return mutt_addwch (wc);
+ if (!(wc & ~0x7f))
+ return printw ("^%c", ((int)wc + 0x40) & 0x7f);
+ if (!(wc & ~0xffff))
+ return printw ("\\u%04x", (int)wc);
+ return printw ("\\u%08x", (int)wc);
}
static size_t width_ceiling (const wchar_t *s, size_t n, int w1)