Character set conversions

Kagamin spam at here.lot
Tue May 31 00:12:56 PDT 2011


Daniel Gibson Wrote:

> Am 31.05.2011 09:02, schrieb Kagamin:
> > Daniel Gibson Wrote:
> > 
> >> In plain C (at least on Linux) you have fun locale-dependent in/output
> >> as well: printf and scanf are locale dependent, so if you use sprintf
> >> to generate a string you'll write into a file (or fprintf directly) with
> >> one locale, reading it with scanf functions with another locale will fail.
> >> Pretty fucking stupid IMHO.
> > 
> > Doesn't C standard specify the locale to be "C" until you set it explicitly?
> 
> At least on Linux it is usually set to whatever you specified on
> installation (usually you just say "I want a german/english/whatever
> installation" and the installer then sets the locales to de_DE.UTF8 or
> whatever).
> Applications use these settings to decide the language of their menus etc

according to N1425
7.11.1.1
4. At program startup, the equivalent of
setlocale(LC_ALL, "C");
is executed.

Fun fact is MS conforms with this specification.


More information about the Digitalmars-d mailing list