summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-11-26 22:23:15 +0000
committerCarl Hetherington <cth@carlh.net>2013-11-26 22:23:15 +0000
commit72eedf0b240c71b9dbd27d1f95b109b48e3200a2 (patch)
treef01295128962cae9fa51e292b22afe066bb7c406 /src/tools
parentad0ddd25c94730bed174756a21c83a348c45687e (diff)
A whole load of UTF-8/-16 confusion fixes for Windows.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/dcpomatic.cc19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index 1d01e4da8..2a0cb9cd3 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -62,7 +62,6 @@ using std::map;
using std::make_pair;
using std::list;
using std::exception;
-using std::ofstream;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
@@ -247,6 +246,22 @@ public:
: wxFrame (NULL, -1, title)
, _servers_list_dialog (0)
{
+#ifdef DCPOMATIC_WINDOWS_CONSOLE
+ AllocConsole();
+
+ HANDLE handle_out = GetStdHandle(STD_OUTPUT_HANDLE);
+ int hCrt = _open_osfhandle((intptr_t) handle_out, _O_TEXT);
+ FILE* hf_out = _fdopen(hCrt, "w");
+ setvbuf(hf_out, NULL, _IONBF, 1);
+ *stdout = *hf_out;
+
+ HANDLE handle_in = GetStdHandle(STD_INPUT_HANDLE);
+ hCrt = _open_osfhandle((intptr_t) handle_in, _O_TEXT);
+ FILE* hf_in = _fdopen(hCrt, "r");
+ setvbuf(hf_in, NULL, _IONBF, 128);
+ *stdin = *hf_in;
+#endif
+
wxMenuBar* bar = new wxMenuBar;
setup_menu (bar);
SetMenuBar (bar);
@@ -332,7 +347,7 @@ private:
std_to_wx (
String::compose (wx_to_std (_("The directory %1 already exists and is not empty. "
"Are you sure you want to use it?")),
- d->get_path().c_str())
+ d->get_path().string().c_str())
)
)) {
return;