X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmain.cpp;h=65a9f4d8d7da10e7537ea51fbb53d49ef3afb355;hb=869247b6;hp=b72725372be83e04874a17570fae7441fc19ef84;hpb=710b7549ea4ee5f87ebb467906272fbb184b6b1b;p=features.git diff --git a/src/main.cpp b/src/main.cpp index b72725372b..65a9f4d8d7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -21,6 +21,11 @@ #include #endif +#ifdef WIN32 +#include +#endif + + using namespace std; @@ -30,12 +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); + lyx::support::os::init(argc, &argv); lyx::LyX the_lyx_instance;