子弹 の VISIONS

NEVER back down ~~

C++博客 首页 新随笔 联系 聚合 管理
  112 Posts :: 34 Stories :: 99 Comments :: 0 Trackbacks

Quote of the Day:
When something can be read without effort, great effort has gone into its writing.
--Enrique Jardiel Poncela

 

为了简化,例程只跟主题相关:

 #include<iostream>

using namespace std;

int main(int argc, char** argv)
{
    cout << "English" << endl;
    wcout << L"中文" << endl;

    return0;
}

1) build log:

“converting to execution character set: Illegal byte sequence”

-finput-charset=charset
Set the input character set, used for translation from the character set of the input file to the source character set used by GCC. If the locale does not specify, or GCC cannot get this information from the locale, the default is UTF-8. This can be overridden by either the locale or this command line option. Currently the command line option takes precedence if there's a conflict. charset can be any encoding supported by the system's iconv library routine.

根据上面的说法,在没有指定locale或GCC不能获取现场信息时,会默认编码为UTF-8。同时,设置也可能会被

-finput-charset=charset 选项指定的设置覆盖 -- 优先采用这个选项。

 

 CodeBlocks 8

-finput-charset=GBK编译选项,使GCC能够正确解码源文件。

 

2) build log:

“error: `std::wcout' has not been declared” 

 

查了半天,结果还是不尽人意,据说是MingW gcc 暂不支持 wostream。

 

 

posted on 2009-12-31 10:36 子弹のVISIONS 阅读(1576) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理