I'm a Python newbie having problems with embedding Python 3.2 in a piece of C++ code.
Here's an example. The code looks like this:
std::cout << "Hello world" << std::endl;
std::wcout << "Hello world" << std::endl;
PyIntitialize();
std::cout << "Hello world" << std::endl;
std::wcout << "Hello world" << std::endl;
And the console output looks like this:
Hello World
Hello World
Hello World
H e l l o W o r l d
It appears that the width of a wchar_t has been reset by Python to twice its original size. On the other hand the width of a char remains the same after the initialization.
Details: Win7 - 64 bit. Visual Studio 2008 for the C++ code sample above. I'm also using Visual Studio 2008 to build Python from source.
Why is Python changing the stdoutput stream (if this is indeed the case as it appears) and what can I do to fix the problem? We use wcout throughout the code, so it has to work (and indeed it did when we were using Python 2.6).
Many thanks.