Is the default locale for a program in * nix "posix"?

From the Linux Programming Interface :

There are two different ways to set the language using setlocale (). The locale argument can be a string indicating one of the locales defined in the system (that is, the name of one of the subdirectories in the / usr / lib / locale directory), for example de_DE or en_US. Alternatively, the locale can be specified as an empty string, which means that locale parameters should be taken from environment variables:

setlocale (LC_ALL, "");

We must make this call so that the program knows the locale environment variables. If the call is omitted, these environment variables will not affect the program.

So, if my program does not call the function setlocaleexplicitly, my program will use the default locale, which is in POSIXthe *nixsystems, right? I cannot search for the specified document.

+4
source share
1 answer

Looking at man

7.4 How programs define a locale

C . . , , ISO C , C.. , , setlocale, :

setlocale (LC_ALL, "");

+5

Source: https://habr.com/ru/post/1656680/


All Articles