c++ utf8转换
leftstrange
我只是一个搬运工......
展开
-
std::string互转UTF-8,std::wstring互转UTF-8
std::string 转 UTF-8:char * string_To_UTF8 (const std::string & str){ int nwLen = ::MultiByteToWideChar(CP_ACP, 0, str.c_str(), -1, NULL, 0); wchar_t* pwBuf = new wchar_t[nwLen + 1];原创 2014-07-03 15:30:05 · 3581 阅读 · 0 评论 -
wstring 转 utc时间
tstring CMainFunction::StringToUTC( tstring cStr) { TCHAR rcStr[MAX_PATH] = {0} ; int nYear, nMonth, nDate, nHour, nMin, nSec; swscanf_s( cStr.c_str(),_T("%d-%d-%d %d:%d:%d"), &nYear, &nMon原创 2016-09-13 15:44:54 · 463 阅读 · 0 评论