Bug#352790: gcc-4.0: gcc doesn't use locale for default input charset
Package: gcc-4.0
Version: 4.0.2-8
Severity: normal
Tags: upstream
Hi,
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.
Regards,
Samuel
-- System Information:
Debian Release: testing/unstable
APT prefers testing
APT policy: (900, 'testing'), (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15
Locale: LANG=fr_FR@euro, LC_CTYPE=fr_FR@euro (charmap=ISO-8859-15)
Versions of packages gcc-4.0 depends on:
ii binutils 2.16.1cvs20060117-1 The GNU assembler, linker and bina
ii cpp-4.0 4.0.2-8 The GNU C preprocessor
ii gcc-4.0-base 4.0.2-8 The GNU Compiler Collection (base
ii libc6 2.3.6-1 GNU C Library: Shared libraries an
ii libgcc1 1:4.0.2-8 GCC support library
Versions of packages gcc-4.0 recommends:
ii libc6-dev 2.3.6-1 GNU C Library: Development Librari
pn libmudflap0-dev <none> (no description available)
-- no debconf information
--
Samuel Thibault <samuel.thibault@ens-lyon.org>
>Ever heard of .cshrc?
That's a city in Bosnia. Right?
(Discussion in comp.os.linux.misc on the intuitiveness of commands.)
Reply to: