Help glibc deal with UTF-8 by setting locale. - stagit-gopher - A git gopher frontend. (mirror)
git clone git://bitreich.org/stagit-gopher/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/stagit-gopher/
Log
Files
Refs
Tags
README
LICENSE
---
commit e6c36b0eb1f0af8fd93eced69c48c271f21f6a12
parent 1d747ca19f3afe0f7b61575a06fa9b37d4384eeb
Author: Quentin Rameau 
Date:   Sun, 25 Jun 2017 23:00:14 +0200

Help glibc deal with UTF-8 by setting locale.

Diffstat:
  M stagit-gopher.c                     |       3 +++

1 file changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/stagit-gopher.c b/stagit-gopher.c
@@ -5,6 +5,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1080,6 +1081,8 @@ main(int argc, char *argv[])
         if (pledge("stdio rpath wpath cpath", NULL) == -1)
                 err(1, "pledge");
 
+        setlocale(LC_CTYPE, "");
+
         for (i = 1; i < argc; i++) {
                 if (argv[i][0] != '-') {
                         if (repodir)