Use nl_langinfo properly to detect if the charset is utf8
[apps/madtty.git] / demo / boxshell.c
index 505f6b9..15fbc41 100644 (file)
@@ -8,6 +8,7 @@
 #include <ncurses.h>
 
 #include <fcntl.h>
+#include <locale.h>
 #include <signal.h>
 #include <stdio.h>
 #include <string.h>
@@ -62,7 +63,17 @@ int main(void)
     signal(SIGCHLD, handler);
     signal(SIGWINCH, handler);
 
-    madtty_initialize();
+    setlocale(LC_ALL, "");
+    initscr();
+    start_color();
+    noecho();
+    raw();
+    nodelay(stdscr, TRUE);
+    keypad(stdscr, TRUE);
+    curs_set(0);
+    ESCDELAY=50;
+    madtty_init_vt100_graphics();
+    madtty_init_colors();
     getmaxyx(stdscr, screen_h, screen_w);
 
     /* create a window with a frame */