CStdioFile Unicode ReadString 读取汉字乱码
1. Unicode 模式下ReadString 需要使用typebinary读取文本,中文才不会乱码
CStdioFile file;
if (file.Open(filePath, CFile::modeRead | CFile::typeBinary) == TRUE){
CString strLine(_T(""));
WORD sign;
file.Read(&sign, 2);
while (file.ReadString(strLine))
{
m_listInfo.InsertString(m_listInfo.GetCount(), strLine);
}
file.Close();
}
标签: MFC StdioFile ReadString
发表评论: