X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=nssm.cpp;h=8dd264ad713d9aa001490fd2c8a2a3fb7a941f33;hb=153133aedadde24a5836707caa3ae3632e422ef3;hp=3c7545ab6283db5b21b0497d310587866368809b;hpb=953c1a429d966133c9d03fc983c9098c4b67b9c2;p=nssm.git diff --git a/nssm.cpp b/nssm.cpp index 3c7545a..8dd264a 100644 --- a/nssm.cpp +++ b/nssm.cpp @@ -85,6 +85,15 @@ int num_cpus() { int _tmain(int argc, TCHAR **argv) { check_console(); +#ifdef UNICODE + /* + Ensure we write in UTF-16 mode, so that non-ASCII characters don't get + mangled. If we were compiled in ANSI mode it won't work. + */ + _setmode(_fileno(stdout), _O_U16TEXT); + _setmode(_fileno(stderr), _O_U16TEXT); +#endif + /* Remember if we are admin */ check_admin();