-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
20e924b
commit 17b5d71
Showing
4 changed files
with
31 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/// This file is a part of windows_taskbar | ||
/// (https://github.com/alexmercerind/windows_taskbar). | ||
/// | ||
/// Copyright (c) 2021 & onwards, Hitesh Kumar Saini <[email protected]>. | ||
/// All rights reserved. | ||
/// Use of this source code is governed by MIT license that can be found in the | ||
/// LICENSE file. | ||
|
||
#include "utils.h" | ||
|
||
#include <Windows.h> | ||
|
||
std::wstring Utf16FromUtf8(std::string string) { | ||
auto size_needed = | ||
::MultiByteToWideChar(CP_UTF8, 0, string.c_str(), -1, NULL, 0); | ||
if (size_needed == 0) { | ||
return std::wstring{}; | ||
} | ||
auto result = std::wstring(size_needed, 0); | ||
auto converted_length = ::MultiByteToWideChar(CP_UTF8, 0, string.c_str(), -1, | ||
&result[0], size_needed); | ||
if (converted_length == 0) { | ||
return std::wstring{}; | ||
} | ||
return result; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters