If we were compiled as a Unicode application, set stdout and stderr
output mode to UTF-16 text. Doing so allows French and Italian accented
characters to show up correctly on the console.
We currently have no analogous method for fixing the output of NSSM when
compiled as an ANSI application.
int _tmain(int argc, TCHAR **argv) {\r
check_console();\r
\r
+#ifdef UNICODE\r
+ /*\r
+ Ensure we write in UTF-16 mode, so that non-ASCII characters don't get\r
+ mangled. If we were compiled in ANSI mode it won't work.\r
+ */\r
+ _setmode(_fileno(stdout), _O_U16TEXT);\r
+ _setmode(_fileno(stderr), _O_U16TEXT);\r
+#endif\r
+\r
/* Remember if we are admin */\r
check_admin();\r
\r
#define NSSM_H\r
\r
#define _WIN32_WINNT 0x0500\r
+#include <fcntl.h>\r
+#include <io.h>\r
#include <shlwapi.h>\r
#include <stdarg.h>\r
#include <stdio.h>\r