ConvertString是一款專業(yè)的字符串編碼轉(zhuǎn)換工具,可以將string語(yǔ)音轉(zhuǎn)化成你需要的編碼形式,能夠設(shè)置密碼,支持UTF-8、GB2312和GBK格式,有需要的朋友可以來本站下載!
使用方法:
1.運(yùn)行exe程序打開軟件
2.選擇需要的password
3.設(shè)置查找范圍
4.然后直接點(diǎn)擊【convart】
不同編碼情況下字符轉(zhuǎn)換方法
(1)CString與string轉(zhuǎn)換方法
//CString轉(zhuǎn)string
CString str = _T("你好");
CStringA strA(str.GetBuffer(0));
string strTemp = strA.GetBuffer(0);
strA.ReleaseBuffer();
//string轉(zhuǎn)CString
CString strNew(strTemp.c_str());
(2)CString與char*轉(zhuǎn)換方法
//CString轉(zhuǎn)char*
CString str = _T("你好");
int nLen = WideCharToMultiByte(CP_ACP, 0, str, str.GetLength(), NULL, 0, NULL, NULL);
char* pCh = new char[nLen + 1];
WideCharToMultiByte(CP_ACP, 0, str, str.GetLength() + 1 ,pCh, nLen + 1, NULL, NULL);
pCh[nLen + 1] = '/0';
//char*轉(zhuǎn)CString
CString strNew(pCh);
(3)string與char*轉(zhuǎn)換方法
//string轉(zhuǎn)char*
string str = "你好";
char* pCh = const_cast
//或 char* pCh = const_cast
//char*轉(zhuǎn)string
string strNew = pCh;