|
From: Ethan M. <merritt@u.washington.edu> - 2005-06-13 18:18:37
|
On Monday 13 June 2005 10:33 am, Hans-Bernhard Broeker wrote:
> Ethan Merritt wrote:
>
> > It would have to be a very fine-grained switch, bracketing each
> > scanf/printf call. For instance a plot command like
> > plot 'foo' using 1:2:(sprintf(format,column(3))) with labels
> > will be mixing scanf and sprintf during the parsing of every data line.
> >
> > Could be done, but I can already hear screams about the performance
> > hit :-)
>
> Well, since we wouldn't be forcing anyone to use any locale setting at
> all, and the default should be "all locales are 'C', so no setlocale()
> calls needed", I consider that a negligible risk.
I've uploaded a patchset to SourceForge that implements
set decimalsign { <value> | {locale {<LOC>}}
My thought is that people can try this out and report back whether
there is a need to separate out the input and output locales.
By the way, it may be obvious but let me state it explicitly:
The existing `set locale` command only affects LC_TIME, the format used
for time/date strings.
The new command options to `set decimalsign` only affect LC_NUMERIC,
the format conventions used by the C library for scanf and printf.
Neither of these affects LC_CTYPE, which controls the character set
and font encoding.
--
Ethan A Merritt merritt@u.washington.edu
Biomolecular Structure Center
Mailstop 357742
University of Washington, Seattle, WA 98195
|