From: Michael Göhler Date: Sun, 14 Sep 2014 09:49:39 +0000 (+0200) Subject: fixed utf-8 encoding issue X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=cbcab1e9d36dee41eb493409507510d8354546c1;p=smdp.git fixed utf-8 encoding issue --- diff --git a/viewer.c b/viewer.c index f262ea2..14acefd 100644 --- a/viewer.c +++ b/viewer.c @@ -21,6 +21,7 @@ * */ +#include // setlocale #include #include #include // strchr @@ -74,6 +75,9 @@ int ncurses_display(deck_t *deck, int notrans, int nofade) { slide = slide->next; } + // set locale to display UTF-8 correctly in ncurses + setlocale(LC_CTYPE, ""); + // replace stdin with current tty if markdown input was piped freopen("/dev/tty", "rw", stdin);