initialize locale

This has two effects:

* The locale may have impact on string formatting. So depending on the
  locale we may end up with different decimal point.
* We can use nl_langinfo() for UTF-8 detection.
This commit is contained in:
Christian Hesse 2015-07-16 08:08:18 +02:00
parent e5f810e0a2
commit 016dbbe6a4
1 changed files with 3 additions and 0 deletions

3
CRT.c
View File

@ -585,6 +585,9 @@ void CRT_init(int delay, int colorScheme) {
CRT_colorScheme = 1; CRT_colorScheme = 1;
CRT_setColors(CRT_colorScheme); CRT_setColors(CRT_colorScheme);
/* initialize locale */
setlocale(LC_ALL, "");
#ifdef HAVE_LIBNCURSESW #ifdef HAVE_LIBNCURSESW
char *locale = setlocale(LC_ALL, NULL); char *locale = setlocale(LC_ALL, NULL);
if (locale == NULL || locale[0] == '\0') if (locale == NULL || locale[0] == '\0')