【发布时间】:2014-04-09 11:41:12
【问题描述】:
参考 http://www.fileformat.info/info/unicode/char/2192/index.htm 表示右箭头在 unicode 字符集中是 0x2192,所以我尝试以几种不同的方式将值写入文件:
#include <fstream>
using namespace std;
int main()
{
ofstream out("out.txt");
wofstream wout("wout.txt");
out << '0x2192' << endl;
out << '\u2192' << endl;
out << L'\u2192' << endl;
out << u'\u2192' << endl;
wout << '0x2192' << endl;
wout << '\u2192' << endl;
wout << L'\u2192' << endl;
wout << u'\u2192' << endl;
return 0;
}
它只打印出数字,没有箭头符号。我究竟做错了什么? PS 另外我想稍后再读回这个角色。提前致谢。
【问题讨论】: