]> git.lyx.org Git - lyx.git/blobdiff - src/main.cpp
tex2lyx: fix import of umlauts and ß in math (#12739)
[lyx.git] / src / main.cpp
index 5c4fb468459dbc3fa2a7ab12bbf418d1b6f7674e..65a9f4d8d7da10e7537ea51fbb53d49ef3afb355 100644 (file)
 #include <ios>
 #endif
 
+#ifdef WIN32
+#include <Windows.h>
+#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.