Z
zade
C has its locale function, and C++ has its locale class. When used, I
don't know their relation. For example , what is the diff for the
codes below:
std::locale::global(std::locale(""));
std::setlocale(LC_ALL,"");
in GNU C++(http://gcc.gnu.org/onlinedocs/libstdc++/manual/
locales.html#manual.localization.locales.locale), it says:
From Josuttis, p. 697-698, which says, that "there is only *one*
relation (of the C++ locale mechanism) to the C locale mechanism: the
global C locale is modified if a named C++ locale object is set as the
global locale" (emphasis Paolo), that is:
std::locale::global(std::locale(""));
affects the C functions as if the following call was made:
std::setlocale(LC_ALL, "");
On the other hand, there is *no* vice versa, that is, calling
setlocale has *no* whatsoever on the C++ locale mechanism, in
particular on the working of locale(""), which constructs the locale
object from the environment of the running program, that is, in
practice, the set of LC_ALL, LANG, etc. variable of the shell.
But in my experience, it is not the same as in windows system.
So what their relation?
don't know their relation. For example , what is the diff for the
codes below:
std::locale::global(std::locale(""));
std::setlocale(LC_ALL,"");
in GNU C++(http://gcc.gnu.org/onlinedocs/libstdc++/manual/
locales.html#manual.localization.locales.locale), it says:
From Josuttis, p. 697-698, which says, that "there is only *one*
relation (of the C++ locale mechanism) to the C locale mechanism: the
global C locale is modified if a named C++ locale object is set as the
global locale" (emphasis Paolo), that is:
std::locale::global(std::locale(""));
affects the C functions as if the following call was made:
std::setlocale(LC_ALL, "");
On the other hand, there is *no* vice versa, that is, calling
setlocale has *no* whatsoever on the C++ locale mechanism, in
particular on the working of locale(""), which constructs the locale
object from the environment of the running program, that is, in
practice, the set of LC_ALL, LANG, etc. variable of the shell.
But in my experience, it is not the same as in windows system.
So what their relation?