commit f040be3adecd03c9d504fa302f7039d151531378
parent d8561bf5886b325a811cc7de9f4046ae519c10c3
Author: Andreas Gruhler <andreas.gruhler@uzh.ch>
Date: Thu, 15 Dec 2016 11:05:30 +0100
Merge pull request #27 from shaggytwodope/master
add support to read locale for utf8 chars
Diffstat:
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
@@ -4,7 +4,7 @@ PREFIX ?= /usr/local
BINDIR ?= $(DESTDIR)$(PREFIX)/bin
CC = gcc
-CFLAGS = -lncurses -Wall
+CFLAGS = -lncursesw -Wall
default: $(TARGET)
diff --git a/diary.c b/diary.c
@@ -256,6 +256,7 @@ void fpath(char* dir, size_t dir_size, struct tm* date, char** rpath, size_t rpa
}
int main(int argc, char** argv) {
+ setlocale(LC_ALL, "");
char diary_dir[80];
char* env_var;
chtype atrs;
diff --git a/diary.h b/diary.h
@@ -8,6 +8,7 @@
#include <errno.h>
#include <dirent.h>
#include <ncurses.h>
+#include <locale.h>
#define YEAR_RANGE 1
#define CAL_WIDTH 21