locale changes, piscreen
This commit is contained in:
@@ -151,9 +151,6 @@ PRIVATE_DEFINITION_START(PICout)
|
||||
static WORD dattr;
|
||||
static DWORD smode;
|
||||
#endif
|
||||
#ifdef HAS_LOCALE
|
||||
std::wstring_convert<std::codecvt_utf8<char16_t>, char16_t> utf8conv;
|
||||
#endif
|
||||
PRIVATE_DEFINITION_END(PICout)
|
||||
|
||||
#ifdef WINDOWS
|
||||
@@ -546,20 +543,24 @@ PICout & PICout::writePIString(const PIString & s) {
|
||||
if (buffer_) {
|
||||
buffer_->append(s);
|
||||
} else {
|
||||
|
||||
if (PICout::isOutputDeviceActive(PICout::StdOut)) {
|
||||
#ifdef HAS_LOCALE
|
||||
std::cout << PRIVATE->utf8conv.to_bytes((char16_t*)&(const_cast<PIString&>(s).front()), (char16_t*)&(const_cast<PIString&>(s).front()) + s.size());
|
||||
#else
|
||||
for (PIChar c: s) std::wcout.put(c.toWChar());
|
||||
#endif
|
||||
}
|
||||
if (PICout::isOutputDeviceActive(PICout::StdOut))
|
||||
stdoutPIString(s);
|
||||
if (PICout::isOutputDeviceActive(PICout::Buffer)) PICout::__string__().append(s);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
void PICout::stdoutPIString(const PIString & s) {
|
||||
#ifdef HAS_LOCALE
|
||||
std::wstring_convert<std::codecvt_utf8<char16_t>, char16_t> utf8conv;
|
||||
std::cout << utf8conv.to_bytes((char16_t*)&(const_cast<PIString&>(s).front()), (char16_t*)&(const_cast<PIString&>(s).front()) + s.size());
|
||||
#else
|
||||
for (PIChar c: s) std::wcout.put(c.toWChar());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void PICout::init() {
|
||||
#ifdef WINDOWS
|
||||
if (__Private__::hOut == 0) {
|
||||
|
||||
Reference in New Issue
Block a user