On Mon, May 23, 2011 at 10:32:04AM -0400, Glenn Fowler wrote:
>
> On Mon, 23 May 2011 16:04:47 +0200 Dr. Werner Fink wrote:
> > it should be noted that I've correct locale setup to avoid false
> > error reports from locale.sh (as with glibc there is no such
> > C_EU.UTF-8 nor C.UTF-8 locale beside C is an alias for POSIX)
>
> the libast locale intercept provides two test locales
> C.UTF-8
> C_EU.UTF-8
> this enables utf-8 multibyte code but does not pull in any other localization
> cruft
> it allows us to write regression tests with deterministic results across all
> platforms
> (some target platforms have limited locale support)
> the difference between the two test locales is in the LC_NUMERIC category
> C.UTF-8 decimal_point='.' thousands_sep=','
> C_EU.UTF-8 decimal_point=',' thousands_sep='.'
AFAIK Great Britain is part of the EU (even if some British People like
to negatew that;) and those also use the for e.g. a million the format:
LC_NUMERIC=en_GB.UTF-8 LC_MEASUREMENT=en_GB.UTF-8 printf "%'f\n" 1000000
1,000,000.000000
in comparision to Germany:
LC_NUMERIC=de_DE.UTF-8 LC_MEASUREMENT=de_DE.UTF-8 printf "%'f\n" 1000000
1.000.000,000000
and C/POSIX is not known by older glibc like glibc 2.9
LC_NUMERIC=POSIX.UTF-8 LC_MEASUREMENT=POSIX.UTF-8 printf '%f\n' 1000000
bash: warning: setlocale: LC_NUMERIC: cannot change locale (POSIX.UTF-8): No
such file or directory
1000000.000000
LC_NUMERIC=C.UTF-8 LC_MEASUREMENT=C.UTF-8 printf '%f\n' 1000000
bash: warning: setlocale: LC_NUMERIC: cannot change locale (C.UTF-8): No such
file or directory
1000000.000000
whereas glibc 2.11.3 does know:
LC_NUMERIC=C.UTF-8 LC_MEASUREMENT=C.UTF-8 printf '%f\n' 1000000
1000000.000000
LC_NUMERIC=POSIX.UTF-8 LC_MEASUREMENT=POSIX.UTF-8 printf '%f\n' 1000000
1000000.000000
> so the locale settings in the ksh test scripts should not be changed
>
> of course this means all tests using the test locales assume that the
> test locales and the ast intercepts actually work
> if you find evidence that the test locales are the root of a regression then
> we need to know that
>
> can you rerun the tests without changing the locale seetings as distributed
> thanks
The errors remain, and without replacing C_EU with a real locale de_DE I see
an error on the Euro symbols in locale.sh.
> background: this all came about from the difficulty of writing a portable
> script that works on all targets that
> (1) determines a UTF-8 locale with decimal_point='.' thousands_sep=','
> (2) determines a UTF-8 locale with decimal_point=',' thousands_sep='.'
> it was much easier to write the locale intercept and provide at least
> C/POSIX locale UTF-8 support on all target platforms
Werner
--
"Having a smoking section in a restaurant is like having
a peeing section in a swimming pool." -- Edward Burr
_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers