windows MinGW gcc compiler garbage problem

Problem Description

Many editors are generally the default file saved as utf-8, but there have been garbled output when the Chinese? Also tried other methods, some garbled, and some chaos?

There are two parameters gcc -finput-charsetencoding specifies the source file, -fexec-charsetspecified multibyte string (const char *) constants stored in the compiled program code set.

MinGW gcc compiler utf-8 file when garbled
MinGW gcc compiler gbk file when normal
MinGW gcc compiler utf-8 file -fexec-charset = gbk display Chinese
MinGW gcc

Guess you like

Origin www.cnblogs.com/wjundong/p/11823166.html