From dfb0040c5b137d69db9b96df218b094dc9db4a17 Mon Sep 17 00:00:00 2001 From: Ilia Maslakov Date: Tue, 20 Oct 2009 19:38:35 +0000 Subject: [PATCH] Ticket #1627 fix: display double width (CJK) characters. Signed-off-by: Ilia Maslakov --- src/viewer/nroff.c | 4 ++++ src/viewer/plain.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/viewer/nroff.c b/src/viewer/nroff.c index 7675bf3a..7c759842 100644 --- a/src/viewer/nroff.c +++ b/src/viewer/nroff.c @@ -180,6 +180,10 @@ mcview_display_nroff (mcview_t * view) #endif tty_print_anychar (c); } +#ifdef HAVE_CHARSET + if (view->utf8 && g_unichar_iswide(c)) + col++; +#endif col++; tty_setcolor (NORMAL_COLOR); } diff --git a/src/viewer/plain.c b/src/viewer/plain.c index aa57027e..3a6938c0 100644 --- a/src/viewer/plain.c +++ b/src/viewer/plain.c @@ -151,6 +151,10 @@ mcview_display_text (mcview_t * view) #endif tty_print_anychar (c); } +#ifdef HAVE_CHARSET + if (view->utf8 && g_unichar_iswide(c)) + col++; +#endif col++; tty_setcolor (NORMAL_COLOR); } -- 2.11.4.GIT