mirror of
https://github.com/modernw/App-Installer-For-Windows-8.x-Reset.git
synced 2026-04-20 02:34:42 +10:00
Update Settings Page.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <Windows.h>
|
||||
#include <locale>
|
||||
#include <codecvt>
|
||||
std::wstring StringToWString (const std::string &str, UINT codePage = CP_ACP)
|
||||
{
|
||||
if (str.empty ()) return std::wstring ();
|
||||
@@ -19,3 +21,13 @@ std::string WStringToString (const std::wstring &wstr, UINT codePage = CP_ACP)
|
||||
WideCharToMultiByte (codePage, 0, wstr.c_str (), -1, &str [0], len, nullptr, nullptr);
|
||||
return str;
|
||||
}
|
||||
std::string WStringToUtf8 (const std::wstring& ws)
|
||||
{
|
||||
static std::wstring_convert <std::codecvt_utf8_utf16 <wchar_t>> conv;
|
||||
return conv.to_bytes (ws);
|
||||
}
|
||||
std::wstring Utf8ToWString (const std::string& s)
|
||||
{
|
||||
static std::wstring_convert <std::codecvt_utf8_utf16 <wchar_t>> conv;
|
||||
return conv.from_bytes (s);
|
||||
}
|
||||
Reference in New Issue
Block a user