-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Thanks https://github.com/Yukari316/ExplorerPatcher_zh-CN , learned a lot!
- Loading branch information
Showing
9 changed files
with
213 additions
and
159 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
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,30 @@ | ||
#include "helper.h" | ||
|
||
LPWSTR Utf8Text(LPCCH input) | ||
{ | ||
//获取输入字符串大小 | ||
// int bufSize = strlen(input); | ||
|
||
//获取所需缓冲大小 | ||
int cchSize = MultiByteToWideChar( | ||
CP_UTF8, | ||
MB_PRECOMPOSED, | ||
input, | ||
-1, | ||
NULL, | ||
0 | ||
); | ||
|
||
LPWSTR output = (wchar_t*)malloc(cchSize*sizeof(wchar_t)); | ||
|
||
MultiByteToWideChar( | ||
CP_UTF8, | ||
MB_PRECOMPOSED, | ||
input, | ||
-1, | ||
output, | ||
cchSize | ||
); | ||
|
||
return output; | ||
} |
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,8 @@ | ||
#ifndef _H_HELPER_H_ | ||
#define _H_HELPER_H_ | ||
|
||
#include <Windows.h> | ||
|
||
LPWSTR Utf8Text(LPCCH input); | ||
|
||
#endif |
Oops, something went wrong.