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.
pull/420/head
nick black 5 years ago
parent 060c0c2a47
commit fbd222b04a

@ -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;
}

Loading…
Cancel
Save