读书人

下面这三地方是不是不支持 unicode ,要

发布时间: 2012-03-20 14:01:11 作者: rapoo

下面这三地方是不是不支持 unicode ,要怎么改?
#include <windows.h>


ofstream out( "C:\\files.txt ",ios::out); //不支持 unicode ,要是文件名含有中文就大不开,怎么办?


WCHAR buffer[4096];
infile.getline(buffer,4096, '\n ') //第一噶参数不能用WCHAR* 怎么办?


wstring temp;
cin> > temp; //不支持 wstring ,怎么办?

[解决办法]
2. 用TCHAR吧,自动根据情况的
[解决办法]
3.用CSting吧
[解决办法]
使用wofstream, wcout, wcin
wofstream out(L "C:\\files.txt ", ios::out);
wchar_t buffer[4096];
infile.getline(buffer,4096, '\n ')

wstring temp;
wcin> > temp;

[解决办法]
那就用wifstream ifile(...)
ifile.getline()
[解决办法]
LZ 有 #include <windows.h>

可以MFC
[解决办法]
google 如何升级基于STL的应用来支持Unicode

读书人网 >C++

热点推荐