X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmain.cpp;h=65a9f4d8d7da10e7537ea51fbb53d49ef3afb355;hb=9ec80456feed688440360e0a493cbf537c4fe5f9;hp=5c4fb468459dbc3fa2a7ab12bbf418d1b6f7674e;hpb=031748d9c88c60d6a7c79b00599955c49a3c56aa;p=lyx.git diff --git a/src/main.cpp b/src/main.cpp index 5c4fb46845..65a9f4d8d7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -21,6 +21,11 @@ #include #endif +#ifdef WIN32 +#include +#endif + + using namespace std; @@ -30,6 +35,14 @@ int main(int argc, char * argv[]) ios_base::sync_with_stdio(false); #endif +#ifdef WIN32 + if (AttachConsole(ATTACH_PARENT_PROCESS)) { + freopen("CONOUT$", "w", stdout); + freopen("CONOUT$", "w", stderr); + } + SetConsoleOutputCP(CP_UTF8); +#endif + // To avoid ordering of global object problems with some // stdlibs we do the initialization here, but still as // early as possible.