[forwarded from http://bugs.debian.org/352790]
Matthias Bug submitter writes: Manual page says: -finput-charset=charset Set the input character set, used for translation from the charac- ter 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 com- mand line option takes precedence if there's a conflict. charset can be any encoding supported by the system's "iconv" library rou- tine. locale charmap ISO-8859-15 My ISO-8859-15-encoded test.c: #include <locale.h> #include <stdio.h> int main(void) { setlocale(LC_ALL,""); printf("|%lc|\n",L'ü'); return 0; } doesn't compile with a simple $ gcc test.c -o test test.c:5:19: error: converting to execution character set: Invalid argument If I encode the file in utf-8, this works, whatever the current locale. Apparently, the default is always utf-8. Gcc should use locale charset as default input charset instead. -- Summary: gcc doesn't use locale for default input charset Product: gcc Version: 4.1.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: other AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: debian-gcc at lists dot debian dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28315