This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 213520 - Cygwin compiler to compile C language in the normal console output Chinese, generate exe file and run separately, abnormal output of Chinese characters, can not be output.
Summary: Cygwin compiler to compile C language in the normal console output Chinese, g...
Status: RESOLVED INCOMPLETE
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 7.1.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: issues@cnd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-04 10:13 UTC by Icefire
Modified: 2012-06-07 12:27 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
更改编码方式 (102.25 KB, image/jpeg)
2012-06-07 12:22 UTC, Icefire
Details
更改项目的编码法方式 (67.47 KB, image/jpeg)
2012-06-07 12:23 UTC, Icefire
Details
编写的测试程序 (50.21 KB, image/jpeg)
2012-06-07 12:25 UTC, Icefire
Details
控制台输出结果 (11.46 KB, image/jpeg)
2012-06-07 12:25 UTC, Icefire
Details
单独运行two.exe的结果 (23.73 KB, image/jpeg)
2012-06-07 12:26 UTC, Icefire
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Icefire 2012-06-04 10:13:26 UTC
Product Version = NetBeans IDE 7.1.1 (Build 201203012225)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.7.0_03
Runtime = Java HotSpot(TM) 64-Bit Server VM 22.1-b02

用 cygwin 编译器编译C语言,项目和编译器的编码方式都改为"GB2312"或者"GBK"等之后,
可以在控制台正常输出中文,但生成的.exe可执行文件单独运行,中文字符输出异常,无法输出(输出空白或者乱码)。
Comment 1 Jesse Glick 2012-06-04 20:47:36 UTC
(acc. to Google Translate)
Comment 2 Alexander Simon 2012-06-05 10:45:58 UTC
Google Translate:
Cygwin compiler to compile C language, the encoding of the project and the compiler is changed to "GB2312" or "GBK"
Chinese in the console to normal output, but generate exe executable file is run separately, the Chinese character output exception, can not be blank or garbled output (output).
Comment 3 Alexander Simon 2012-06-05 10:54:19 UTC
Please, provide steps to reproduce problem.
Comment 4 Icefire 2012-06-07 12:22:47 UTC
Created attachment 120489 [details]
更改编码方式
Comment 5 Icefire 2012-06-07 12:23:43 UTC
Created attachment 120490 [details]
更改项目的编码法方式
Comment 6 Icefire 2012-06-07 12:25:01 UTC
Created attachment 120491 [details]
编写的测试程序
Comment 7 Icefire 2012-06-07 12:25:35 UTC
Created attachment 120492 [details]
控制台输出结果
Comment 8 Icefire 2012-06-07 12:26:21 UTC
Created attachment 120493 [details]
单独运行two.exe的结果
Comment 9 Icefire 2012-06-07 12:27:57 UTC
正常启动netbeans,选择“工具”-->“插件”-->“已安装”-->选择“C/C++”-->选择“激活”-->重启netbeans,
“新建项目”-->选择“C/C++项目”有提示说必须安装编译器什么的,然后我就按照网页上说的安装了“cygwin”,并且验证成功,然后新建一个C/C++的样例“欢迎使用”,按照步骤,验证成功!
下一步我新建我自己的项目:“two”,选择“工具”-->“选项”-->选择“C/C++”-->更改编码方式为“GB2312”(见图片),-->在项目“two”上右击选择“属性”-->更改编码方式为“GB2312”,新建源文件,
编写简单程序进行验证,
【
#include <stdio.h>
#include <stdlib.h>
int main(int argc,char** argv)
{

    printf("你好!");
    getchar();
    return (EXIT_SUCCESS);
}
】
输出到控制台成功,
去相应的目录(\two\dist\Debug\Cygwin-Windows)下找到“two.exe”文件单独运行,
输出为乱码!