From 13eb0a574f22bb40e8ed0ea4be70be44eb266938 Mon Sep 17 00:00:00 2001 From: Daniel Coonce Date: Sat, 30 Jan 2021 21:35:57 -0600 Subject: Use Boost library to read argv as UTF-8 in Windows Windows uses UTF-16 for command line arguments, so use boost::nowide to convert to UTF-8. Fixes #1986 --- src/main.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/main.cc') diff --git a/src/main.cc b/src/main.cc index 218579cf..37203ff4 100644 --- a/src/main.cc +++ b/src/main.cc @@ -35,6 +35,10 @@ // was moved there for the sake of clarity here #include "session.h" +#if HAVE_BOOST_NOWIDE +#include +#endif + #ifdef HAVE_EDIT #include #endif @@ -51,6 +55,10 @@ int main(int argc, char * argv[], char * envp[]) { int status = 1; +#if HAVE_BOOST_NOWIDE + boost::nowide::args a(argc, argv); // Fix command-line encoding on Windows +#endif + #if HAVE_BOOST_PYTHON argv0 = argv[0]; #endif -- cgit v1.2.3