pinosaur
/
smdp.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
replace pseudo UTF-8 with real wide character support
[smdp.git]
/
src
/
main.c
diff --git
a/src/main.c
b/src/main.c
index
37af9bc
..
e762fbb
100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-19,6
+19,7
@@
#include <errno.h>
#include <getopt.h>
#include <errno.h>
#include <getopt.h>
+#include <locale.h> // setlocale
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@
-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;
// open file or set input to STDIN
char *file = NULL;
FILE *input;