1

I'm rather curious about the phenomenon, std::wcout can't output the whole content of std::wstring. Am I missing something?

Here is my output:

F:\
F:\

My code snippet is as follows:

std::wstring ws(L"F:\\右旋不规则.pdf");
std::wcout << ws << std::endl;
std::wcout << ws.data() << std::endl;
Triumphant
  • 948
  • 1
  • 11
  • 28
  • Perhaps this might give you a clue: http://coliru.stacked-crooked.com/view?id=e16148d281202045a5f3b4565c85a15b-3b440a87a52fe2ae7c853c82f4c5144f – chris Jul 24 '13 at 07:19
  • Try setup locale ( std::wcout.imbue() ), or experiment with codecvt. – user1837009 Jul 24 '13 at 07:35

1 Answers1

1

There are already several threads on this topic:

Output unicode strings in Windows console app

Using Unicode font in C++ console app

Output Unicode to console Using C++, in Windows

The point is you need the system to be able to display your Chinese characters (they are Chinese, right?). I don't think that the default fonts available for the console are able to do that. Lucinda Console could be used for many Unicode characters, but I don't think it's able to display Chinese. If you have a font for that, you can add it to the Console.

How to display japanese Kanji inside a cmd window under windows?

https://superuser.com/questions/5035/how-to-change-the-windows-xp-console-font

Community
  • 1
  • 1
Marius Bancila
  • 16,053
  • 9
  • 49
  • 91