首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

MFC 保存文件到txt 乱码有关问题,多谢

2013-04-20 
MFC 保存文件到txt 乱码问题,求助谢谢std::ofstream outfile (c:\\2.html) CString name我的论坛ou

MFC 保存文件到txt 乱码问题,求助谢谢

std::ofstream outfile ("c:\\2.html"); 
CString name="我的论坛";
outfile<<name<<"\r\n";


结果保存起来的结果是这样的:
0039E2A0

环境vs2008 项目编码是unicode
txt编码是ANSI的。

怎么能让显示成正确的,谢谢啊
[解决办法]
std::ofwstream outfile ("c:\\2.html"); 
outfile.imbue(std::locale("chs"));
CString name="我的论坛";
outfile<<name<<"\r\n";

热点排行