国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
c++ ANSI、UNICODE、UTF8互轉(zhuǎn)
    static std::wstring MBytesToWString(const char* lpcszString);
    
static std::string WStringToMBytes(const wchar_t* lpwcszWString);
    
static std::wstring UTF8ToWString(const char* lpcszString);
    
static std::string WStringToUTF8(const wchar_t* lpwcszWString);

std::wstring KKLogObject::MBytesToWString(const char* lpcszString)
{
    
int len = strlen(lpcszString);
    
int unicodeLen = ::MultiByteToWideChar(CP_ACP, 0, lpcszString, -1, NULL, 0);
    wchar_t
* pUnicode = new wchar_t[unicodeLen + 1];
    memset(pUnicode, 
0, (unicodeLen + 1* sizeof(wchar_t));
    ::MultiByteToWideChar(CP_ACP, 
0, lpcszString, -1, (LPWSTR)pUnicode, unicodeLen);
    wstring wString 
= (wchar_t*)pUnicode;
    delete [] pUnicode;
    
return wString;
}

std::
string KKLogObject::WStringToMBytes(const wchar_t* lpwcszWString)
{
    
char* pElementText;
    
int iTextLen;
    
// wide char to multi char
    iTextLen = ::WideCharToMultiByte(CP_ACP, 0, lpwcszWString, -1, NULL, 0, NULL, NULL);
    pElementText 
= new char[iTextLen + 1];
    memset((
void*)pElementText, 0, (iTextLen + 1* sizeof(char));
    ::WideCharToMultiByte(CP_ACP, 
0, lpwcszWString, 0, pElementText, iTextLen, NULL, NULL);
    std::
string strReturn(pElementText);
    delete [] pElementText;
    
return strReturn;
}

std::wstring KKLogObject::UTF8ToWString(
const char* lpcszString)
{
    
int len = strlen(lpcszString);
    
int unicodeLen = ::MultiByteToWideChar(CP_UTF8, 0, lpcszString, -1, NULL, 0);
    wchar_t
* pUnicode;
    pUnicode 
= new wchar_t[unicodeLen + 1];
    memset((
void*)pUnicode, 0, (unicodeLen + 1* sizeof(wchar_t));
    ::MultiByteToWideChar(CP_UTF8, 
0, lpcszString, -1, (LPWSTR)pUnicode, unicodeLen);
    wstring wstrReturn(pUnicode);
    delete [] pUnicode;
    
return wstrReturn;
}

std::
string KKLogObject::WStringToUTF8(const wchar_t* lpwcszWString)
{
    
char* pElementText;
    
int iTextLen = ::WideCharToMultiByte(CP_UTF8, 0, (LPWSTR)lpwcszWString, -1, NULL, 0, NULL, NULL);
    pElementText 
= new char[iTextLen + 1];
    memset((
void*)pElementText, 0, (iTextLen + 1* sizeof(char));
    ::WideCharToMultiByte(CP_UTF8, 
0, (LPWSTR)lpwcszWString, -1, pElementText, iTextLen, NULL, NULL);
    std::
string strReturn(pElementText);
    delete [] pElementText;
    
return strReturn;
}
本站僅提供存儲服務,所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權內(nèi)容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
編碼轉(zhuǎn)換的方法(UNICODE/ASCII/UTF
CString、TCHAR*、char*轉(zhuǎn)換
WideCharToMultiByte和MultiByteToWideChar函數(shù)的用法
將網(wǎng)頁保存為mht
Unicode,UTF8互轉(zhuǎn)
c中實現(xiàn)utf8和gbk的互轉(zhuǎn)
更多類似文章 >>
生活服務
分享 收藏 導長圖 關注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服