In an XCode project, if I use std::cout
to write to the console the output is fine.
However, if I use std::wcout
I get no output.
I know that this is a thorny issue in C++, and I've been googling around to try and find a specific solution in the XCode case. A couple of things I found that it was suggested should work were:
std::cout.imbue( std::locale("") );
and
std::setlocale(LC_ALL, "");
Neither of these have made any difference. Before I resign myself to spending the next couple of weeks studying the facets API just to be able to write to the console I thought I'd check with the esteemed audidence here.
[Update]
I think the reason for the problem I've been having is actually to do with the specific encoding of some of the strings I'm trying to print.
If I send just a string literal, using the L"my string" syntax
it works! It appears this is using UTF32 - little endian encoding.
However, I've been mixing this with strings I've been passed from Objective C++ code using NSUTF32BigEndianStringEncoding encoding. It's this mix of encodings that's causing the problems.
I think we can consider this matter closed. Thanks for reading.