From fbd222b04a53a344d50bc44964728d991605340e Mon Sep 17 00:00:00 2001 From: nick black Date: Sat, 21 Mar 2020 20:28:50 -0400 Subject: [PATCH] notcurses_init(): mention setlocale in error If notcurses_init() fails due to a bad encoding, it's probably because someone didn't call setlocale(3). Make a suggestion in the error message. Resolves #414. --- src/lib/notcurses.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index 5aa9bb2b6..248f9945a 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -843,7 +843,7 @@ notcurses* notcurses_init(const notcurses_options* opts, FILE* outfp){ } const char* encoding = nl_langinfo(CODESET); if(encoding == NULL || (strcmp(encoding, "ANSI_X3.4-1968") && strcmp(encoding, "UTF-8"))){ - fprintf(stderr, "Encoding (\"%s\") was neither ANSI_X3.4-1968 nor UTF-8, refusing to start\n", + fprintf(stderr, "Encoding (\"%s\") was neither ANSI_X3.4-1968 nor UTF-8, refusing to start\n Did you call setlocale()?\n", encoding ? encoding : "none found"); return NULL; }