aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/vcpkg.cpp
diff options
context:
space:
mode:
authorAlexander Karatarakis <alex@karatarakis.com>2017-08-25 17:35:03 -0700
committerGitHub <noreply@github.com>2017-08-25 17:35:03 -0700
commitf578dd6d072800f9e8ce11f3cc527bbe3e6c24dc (patch)
tree4cfb67d1efa0528871a4d4c2a9b9589231f5e54e /toolsrc/src/vcpkg.cpp
parent98ee8a949ad4bfdfa9bf0411b552a23c923eaff7 (diff)
parent67b9475ef29496508640f73410a10ecf737389eb (diff)
downloadvcpkg-f578dd6d072800f9e8ce11f3cc527bbe3e6c24dc.tar.gz
vcpkg-f578dd6d072800f9e8ce11f3cc527bbe3e6c24dc.zip
Merge pull request #1682 from Mixaill/fix-1660
[vcpkg] use UTF-8 for console input/output
Diffstat (limited to 'toolsrc/src/vcpkg.cpp')
-rw-r--r--toolsrc/src/vcpkg.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp
index 9da501ec0..f37d079a6 100644
--- a/toolsrc/src/vcpkg.cpp
+++ b/toolsrc/src/vcpkg.cpp
@@ -192,9 +192,13 @@ int wmain(const int argc, const wchar_t* const* const argv)
{
if (argc == 0) std::abort();
- *GlobalState::timer.lock() = ElapsedTime::create_started();
+ GlobalState::g_init_console_cp = GetConsoleCP();
+ GlobalState::g_init_console_output_cp = GetConsoleOutputCP();
+
+ SetConsoleCP(65001);
+ SetConsoleOutputCP(65001);
- // Checks::register_console_ctrl_handler();
+ *GlobalState::timer.lock() = ElapsedTime::create_started();
const std::string trimmed_command_line = trim_path_from_command_line(Strings::to_utf8(GetCommandLineW()));
@@ -212,7 +216,7 @@ int wmain(const int argc, const wchar_t* const* const argv)
if (auto p = args.sendmetrics.get()) Metrics::g_metrics.lock()->set_send_metrics(*p);
if (auto p = args.debug.get()) GlobalState::debugging = *p;
- vcpkg::Checks::register_console_ctrl_handler();
+ Checks::register_console_ctrl_handler();
if (GlobalState::debugging)
{