From 2bd199b69b49aa93c9eb2efa4cd5276ec638ee38 Mon Sep 17 00:00:00 2001 From: Jose Date: Tue, 8 Nov 2016 11:31:04 +0100 Subject: ICE-6692 - Review command line input usage to support unicode on Windows --- cpp/src/IceGrid/Client.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'cpp/src/IceGrid/Client.cpp') diff --git a/cpp/src/IceGrid/Client.cpp b/cpp/src/IceGrid/Client.cpp index c0c58603453..8dafd14f4ed 100644 --- a/cpp/src/IceGrid/Client.cpp +++ b/cpp/src/IceGrid/Client.cpp @@ -31,6 +31,8 @@ # include #else # include +# include +# include #endif using namespace std; @@ -256,14 +258,17 @@ interruptCallback(int /*signal*/) int wmain(int argc, wchar_t* argv[]) - +{ + // + // Enable binary input mode for stdin to avoid automatic conversions. + // + _setmode(_fileno(stdin), _O_BINARY); #else int main(int argc, char* argv[]) - -#endif { +#endif Client app; StringSeq args = argsToStringSeq(argc, argv); return app.main(args); -- cgit v1.2.3