From 1f7bb99c5df169fe58f34298e02265a192f2e8de Mon Sep 17 00:00:00 2001 From: fanlumaster <1730976608@qq.com> Date: Wed, 16 Apr 2025 00:47:10 +0800 Subject: [PATCH] [chore]: add some utils --- server/src/utils/common_utils.cpp | 5 +++++ server/src/utils/common_utils.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/server/src/utils/common_utils.cpp b/server/src/utils/common_utils.cpp index 69b6ffe6..489bfa1a 100644 --- a/server/src/utils/common_utils.cpp +++ b/server/src/utils/common_utils.cpp @@ -9,4 +9,9 @@ void ShowErrorMessage(HWND hWnd, const std::wstring &message) std::string wstring_to_string(const std::wstring &wstr) { return boost::locale::conv::utf_to_utf(wstr); +} + +std::wstring string_to_wstring(const std::string &str) +{ + return boost::locale::conv::utf_to_utf(str); } \ No newline at end of file diff --git a/server/src/utils/common_utils.h b/server/src/utils/common_utils.h index 29bc47d7..9d0618e9 100644 --- a/server/src/utils/common_utils.h +++ b/server/src/utils/common_utils.h @@ -5,4 +5,5 @@ void ShowErrorMessage(HWND, const std::wstring &); -std::string wstring_to_string(const std::wstring &); \ No newline at end of file +std::string wstring_to_string(const std::wstring &); +std::wstring string_to_wstring(const std::string &); \ No newline at end of file