Dalamud.Boot: use unicode::convert

This commit is contained in:
Soreepeong 2024-02-15 03:55:00 +09:00
parent 45d30ed9d2
commit edc5826fe0
3 changed files with 7 additions and 19 deletions

View file

@ -578,16 +578,6 @@ std::vector<std::string> utils::get_env_list(const wchar_t* pcszName) {
return res;
}
std::wstring utils::to_wstring(const std::string& str) {
if (str.empty()) return std::wstring();
size_t convertedChars = 0;
size_t newStrSize = str.size() + 1;
std::wstring wstr(newStrSize, L'\0');
mbstowcs_s(&convertedChars, &wstr[0], newStrSize, str.c_str(), _TRUNCATE);
wstr.resize(convertedChars - 1);
return wstr;
}
std::filesystem::path utils::get_module_path(HMODULE hModule) {
std::wstring buf(MAX_PATH, L'\0');
while (true) {