mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
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.
This commit is contained in:
parent
060c0c2a47
commit
fbd222b04a
@ -843,7 +843,7 @@ notcurses* notcurses_init(const notcurses_options* opts, FILE* outfp){
|
|||||||
}
|
}
|
||||||
const char* encoding = nl_langinfo(CODESET);
|
const char* encoding = nl_langinfo(CODESET);
|
||||||
if(encoding == NULL || (strcmp(encoding, "ANSI_X3.4-1968") && strcmp(encoding, "UTF-8"))){
|
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");
|
encoding ? encoding : "none found");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user