i think it's time for version 1.0
[smdp.git] / src / main.c
index 37af9bc..3d63052 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * mdp -- A command-line based markdown presentation tool.
- * Copyright (C) 2014 Michael Goehler
+ * Copyright (C) 2015 Michael Goehler
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -19,6 +19,7 @@
 
 #include <errno.h>
 #include <getopt.h>
+#include <locale.h> // setlocale
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -40,7 +41,7 @@ void usage() {
 
 void version() {
     printf("mdp %d.%d.%d\n", MDP_VER_MAJOR, MDP_VER_MINOR, MDP_VER_REVISION);
-    printf("Copyright (C) 2014 Michael Goehler\n");
+    printf("Copyright (C) 2015 Michael Goehler\n");
     printf("License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\n");
     printf("This is free software: you are free to change and redistribute it.\n");
     printf("There is NO WARRANTY, to the extent permitted by law.\n");
@@ -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;