#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <string>
#include <locale>
using namespace std;
void read_memo()
{
FILE* pfile = fopen("D:\\memo.txt", "rb");
if (!pfile) return;
fseek(pfile, 2, 0);
wchar_t buf[1024];
wstring line;
const wstring CRLF = L"\x000D\x000A";
while (!feof(pfile))
{
fgetws(buf, 1024, pfile);
line = buf;
//Trim the CRLF(ENTER+RETURN) character
if(line.find(CRLF) != wstring::npos)
line = line.substr(0, line.find(CRLF));
}
fclose(pfile);
}
读取UNICODE文本到wstring
最新推荐文章于 2024-06-04 09:36:10 发布