From 89c2756a35d6f083d8b3f5fffafbe3fecd09150a Mon Sep 17 00:00:00 2001 From: "han.liu" Date: Thu, 27 Oct 2022 22:00:00 +0800 Subject: [PATCH] Fix error message encode incorrect on win --- src/keytar_win.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/keytar_win.cc b/src/keytar_win.cc index 60a56dab..6c5b8d41 100644 --- a/src/keytar_win.cc +++ b/src/keytar_win.cc @@ -108,7 +108,7 @@ std::string getErrorMessage(DWORD errorCode) { LPWSTR errBuffer; ::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, errorCode, 0, (LPWSTR) &errBuffer, 0, NULL); - std::string errMsg = wideCharToAnsi(errBuffer); + std::string errMsg = wideCharToUtf8(errBuffer); LocalFree(errBuffer); return errMsg; }