-Finput-charset is used to specify the character encoding of the input file. If this parameter is not specified, characters such as l "Chinese" cannot be correctly converted to wide characters. On the contrary, if the character encoding of the input file is not specified, the GCC in the mingw compiling environment will parse the source file according to the local character encoding, and the normal string will still be compiled into the program according to the local character encoding used by the file, and the string containing the wide character scalar L according to local encoding to identify and convert to UTF-8 encoding (very strange, it is not converted to unicode encoding, instead, after the character set of the source file is specified, it is converted to UTF-16 encoding. At the same time, this method does not specify the source file encoding method, but uses the wide character scalar L to indicate that the compiler will convert a specific string to unicode encoding, it will bring a warning, rather than a compilation error ).
-Fexec-charset specifies the format used by the string.
For example, if the source file is in GBK format, the strings in the source file are encoded by GBK when compiled into a program. But if your program actually requires strings to be encoded by UTF-8, you can specify the compilation option-fexec-charset = UTF-8-finput-charset = GBK
In addition, the common unicode encoding in windows should be written as a UTF-16 here. The Unicode encoding in Linux is UTF32.
-Fwide-Exec-charset specifies the format when wide characters are used in C \ c ++. The default format is UTF-16 or UTF32, depending on the wide character format used in your system. (As mentioned above, Windows uses UTF16 unicode encoding, which is a encoding format of the ucs2 character set; Linux uses UTF32 encoding, which is an encoding format of ucs4. Correspondingly, the Windows compiler generally sets wchar_t to 2 bytes wide, while the Linux compiler generally defines wchar_t to 4 bytes wide .)
From http://hi.baidu.com/xyk34/item/a418d7a1b219b8716cd455fe