123456789101112131415161718192021222324252627282930313233343536373839404142 |
- #pragma once
- #include "stdafx.h"
- #include<string>
- using namespace std;
- #pragma region 字符串处理
- //说明:Unicode转换为ANSI,由于系统语言区域设置原因,目前只支持处理英文内容
- class CharConvert
- {
- #pragma region Unicode和ANSI
- public:
- /// <summary>
- /// 多字节字符转换为宽字符
- /// </summary>
- static wstring GetWideCharW(char* multiByte);
- static wstring GetWideCharW(string* multiByte);
- /// <summary>
- /// 宽字符转换为多字节字符
- /// </summary>
- /// <param name="wideChar"></param>
- /// <returns></returns>
- static char* GetMultiByteW(wchar_t* wideChar);
- static char* GetMultiByteW(wstring wideStr);
- static char* GetMultiByteUTF8W(wchar_t* wideChar);
- static wstring ReplaceSubStrW(wstring sourceStr, const wstring& oldSubStr, const wstring& newSubStr);
- #pragma endregion
-
- #pragma region 字符转换
- static char* StringTocharPtrA(string* sourceStr);
- static wchar_t* wstringToWchar_tPtrW(wstring ws);
- static char* GetWstringToCharPtr(wstring ws);
- #pragma endregion
- };
- #pragma endregion
|