0031171: Draw - support Unicode input / output in console on Windows
[occt.git] / src / Draw / CommandWindow.cxx
index 79b8653..9cc4556 100644 (file)
@@ -185,8 +185,9 @@ LRESULT APIENTRY EditProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam )
           GetCaretPos (&pos);
           SendMessageW (hWnd, EM_REPLACESEL, 0, (LPARAM )THE_PROMPT);
           // Display the command in the console
-          std::wcout << aCmdBuffer << std::endl;
-          //TCollection_AsciiString aCmdUtf8 (aCmdBuffer + sizeof(THE_PROMPT) / sizeof(wchar_t) - 1);
+          //std::wcout << aCmdBuffer << std::endl; // wcout does not work well with UTF-8
+          TCollection_AsciiString aCmdUtf8 (aCmdBuffer + sizeof(THE_PROMPT) / sizeof(wchar_t) - 1);
+          std::cout << aCmdUtf8.ToCString() << std::endl;
           //Draw_Interprete (aCmdUtf8.ToCString());
           //if (toExit) { DestroyProc (hWnd); }
           wcscpy_s (console_command, aCmdBuffer + sizeof(THE_PROMPT) / sizeof(wchar_t) - 1);