replace pseudo UTF-8 with real wide character support
[smdp.git] / src / main.c
index 37af9bc..e762fbb 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <errno.h>
 #include <getopt.h>
+#include <locale.h> // setlocale
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -82,6 +83,9 @@ int main(int argc, char *argv[]) {
         }
     }
 
+    // set locale to read and display UTF-8 correctly in ncurses
+    setlocale(LC_CTYPE, "en_US.UTF8");
+
     // open file or set input to STDIN
     char *file = NULL;
     FILE *input;