Help glibc deal with UTF-8 by setting locale. - stagit-gopher - A git gopher fr… | |
git clone git://bitreich.org/stagit-gopher/ git://enlrupgkhuxnvlhsf6lc3fziv5h2h… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
LICENSE | |
--- | |
commit e6c36b0eb1f0af8fd93eced69c48c271f21f6a12 | |
parent 1d747ca19f3afe0f7b61575a06fa9b37d4384eeb | |
Author: Quentin Rameau <[email protected]> | |
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 <inttypes.h> | |
#include <libgen.h> | |
#include <limits.h> | |
+#include <locale.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
@@ -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) |