CodeBlocks中文支持,编译时出现Illegal byte sequence错误
转:http://blog.csdn.net/ynzhangyao/archive/2007/12/21/1957265.aspx
GCC在编译时,无法将汉字进行正确的转换,解决的办法是,明确告诉GCC编译器,输入的文件是中文的,这样就可以了,设置编译器参数,因为在程序中使用中文,将是非常常见的,所以,我将设置全局的参数,如下:settings->Compiler and debugger,如下图:
[img=http://p.blog.csdn.net/images/p_blog_csdn_net/ynzhangyao/compiler_settings.JPG[/img]
http://p.blog.csdn.net/images/p_blog_csdn_net/ynzhangyao/compiler_settings.JPG
设置编译选项:-finput-charset=GBK