views:

77

answers:

1

Hi, I am trying to print a wstring/wchar_t in xcode to the console but unfortunatelly it only works with basic chars (i think ascii) chars, everything else gets displayed in numbers, for instance the following:

std::cout << "äöüu"<< std::endl;
std::wcout << L"äöüu" << std::endl;

while the cout version prints "äöüu" as expected I get the following when using wchar_t:

\344\366\374u

any ideas about how to fix this? I am using xcode 3.2.2 64 bit and gcc 4.2 with file encoding set to Unicode (UTF-8)

Thanks!

A: 

If you use wxWidgets, wxString handles this for you automagically, using wxConvCurrent.

Android Eve