CodeLite编译中文宽字符问题
c++吧
全部回复
仅看楼主
level 11
gameloftyou
楼主
wchar_t wc[] = L"中国";
编译上边这句时出错:Illegal byte sequence
请问该如何设置编译器才能让它通过?
2012年05月02日 04点05分
1
level 6
nvckPlus
刚开始也用的Codelite,不过启动很慢,还是老老实实的用vs了。
2012年05月02日 08点05分
2
level 5
songpf457
我用-finput-charset=gbk可以通过编译,但是死活打印不出来
2012年05月02日 09点05分
3
level 11
gameloftyou
楼主
这个应该可以了
#include <iostream>
#include <stdlib.h>
#include <locale.h>
using namespace std;
int main()
{
wchar_t a[] = L"世界,你好!";
_wsetlocale(LC_ALL,L"chs");
wcout<<a<<endl;
system("pause");
return 0;
}
2012年05月02日 10点05分
4
level 5
songpf457
什么也显示不出来呢
2012年05月03日 00点05分
5
level 11
gameloftyou
楼主
我的可以显示
2012年05月03日 00点05分
6
1