D
dertopper
Hello newsgroup,
is it possible to create a std::locale object without changing the
global C locale? Is this implementation defined?
My problem is that I work in a multi-threaded environment that has to
deal with two different locales. Unfortunately, the code uses plain C
functions for IO at many places. However, there is a single point that
uses std::isprint with a C++ locale that is different from the
standard locale. That's why I'm interested in quick and dirty solution
to construct a C++ locale without changing the global C locale.
I've found two other possible work-arounds: (A) printf_l. I don't know
whether this is part of the C standard but nevertheless my IO library
doesn't contain it. (B) A Microsoft Visual C specific solution using a
function called _configthreadlocale which is also not part of my IO
library (there is no information available when this function was
added to Visual C).
Any suggestions (even if they are just "replace all C calls by
iostream calls") are highly welcome.
TIA,
Stuart
is it possible to create a std::locale object without changing the
global C locale? Is this implementation defined?
My problem is that I work in a multi-threaded environment that has to
deal with two different locales. Unfortunately, the code uses plain C
functions for IO at many places. However, there is a single point that
uses std::isprint with a C++ locale that is different from the
standard locale. That's why I'm interested in quick and dirty solution
to construct a C++ locale without changing the global C locale.
I've found two other possible work-arounds: (A) printf_l. I don't know
whether this is part of the C standard but nevertheless my IO library
doesn't contain it. (B) A Microsoft Visual C specific solution using a
function called _configthreadlocale which is also not part of my IO
library (there is no information available when this function was
added to Visual C).
Any suggestions (even if they are just "replace all C calls by
iostream calls") are highly welcome.
TIA,
Stuart