diff options
author | Thomas Adam <thomas@xteddy.org> | 2016-04-26 10:01:16 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2016-04-26 10:01:16 +0100 |
commit | 819ad1a007968fd5ab8e850deea04f36c7caa64f (patch) | |
tree | 285c0cd75f5cb92f7238306508d2ab5d2583e04f /utf8.c | |
parent | 3b833a0c01e984996afd5d9eb9334b291d84489e (diff) | |
parent | d303e552582e311aae9a246651dc3816775707b7 (diff) | |
download | rtmux-819ad1a007968fd5ab8e850deea04f36c7caa64f.tar.gz rtmux-819ad1a007968fd5ab8e850deea04f36c7caa64f.tar.bz2 rtmux-819ad1a007968fd5ab8e850deea04f36c7caa64f.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -18,6 +18,7 @@ #include <sys/types.h> +#include <errno.h> #include <stdlib.h> #include <string.h> #include <wchar.h> @@ -115,8 +116,10 @@ utf8_width(wchar_t wc) int width; width = wcwidth(wc); - if (width < 0 || width > 0xff) + if (width < 0 || width > 0xff) { + log_debug("Unicode %04x, wcwidth() %d", wc, width); return (-1); + } return (width); } @@ -126,6 +129,8 @@ utf8_combine(const struct utf8_data *ud, wchar_t *wc) { switch (mbtowc(wc, ud->data, ud->size)) { case -1: + log_debug("UTF-8 %.*s, mbtowc() %d", (int)ud->size, ud->data, + errno); mbtowc(NULL, NULL, MB_CUR_MAX); return (UTF8_ERROR); case 0: |