Support the locale-supplied character set where appropriate. It's
[sgt/halibut] / main.c
diff --git a/main.c b/main.c
index f486a3d..61b37f7 100644 (file)
--- a/main.c
+++ b/main.c
@@ -3,6 +3,7 @@
  */
 
 #include <assert.h>
+#include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include "halibut.h"
@@ -48,6 +49,8 @@ int main(int argc, char **argv) {
     paragraph *cfg, *cfg_tail;
     void *pre_backend_data[16];
 
+    setlocale(LC_ALL, "");
+
     /*
      * Set up initial (default) parameters.
      */
@@ -260,7 +263,7 @@ int main(int argc, char **argv) {
        in.pushback = NULL;
        in.reportcols = reportcols;
        in.stack = NULL;
-       in.defcharset = CS_ASCII;
+       in.defcharset = locale_charset();
 
        idx = make_index();