X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmain.cpp;h=65a9f4d8d7da10e7537ea51fbb53d49ef3afb355;hb=9ec80456feed688440360e0a493cbf537c4fe5f9;hp=5e09dd86fb27ac2dba298e16c31ad01ca62c61b2;hpb=f1cba8ff64b369792fd49f5ddf90e8126ab476ac;p=lyx.git diff --git a/src/main.cpp b/src/main.cpp index 5e09dd86fb..65a9f4d8d7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -14,7 +14,6 @@ #include "LyX.h" #include "support/debug.h" -#include "support/gettext.h" #include "support/os.h" #include @@ -22,6 +21,11 @@ #include #endif +#ifdef WIN32 +#include +#endif + + using namespace std; @@ -31,15 +35,20 @@ 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. lyx::lyxerr.setStream(cerr); - lyx::support::os::init(argc, argv); - - // initialize for internationalized version *EK* - lyx::locale_init(); + lyx::support::os::init(argc, &argv); lyx::LyX the_lyx_instance;