Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
2k stars 559 forks source link

setlocale(LC_NUMERIC...) produces different results in 5.005 and 5.6 #2340

Closed p5pRT closed 21 years ago

p5pRT commented 24 years ago

Migrated from rt.perl.org#3664 (status was 'resolved')

Searchable as RT3664$

p5pRT commented 24 years ago

From ck@held.mind.de

Created by ck@held.mind.de

This is a bug report for perl from ck@​held.mind.de\, generated with the help of perlbug 1.28 running under perl v5.6.0.

----------------------------------------------------------------- This script produces different output under Perl 5.6 and Perl5.005​:

use POSIX qw(locale_h strftime); use locale;

setlocale(LC_NUMERIC\,"de_DE");

printf "%10.3f %10.2f"\, 3.1\, 3142.79098

Under Perl5.005\, I see   3\,100 3142\,79 while Perl5.6 gives   3\,100 3142.79

The first result is nearly correct (the thousands separator is missing\, which should be a dot\, but this could be a problem with locale setup). The second result is wrong for the second number​: It should use a comma instead of a dot.

I'm running SuSE Linux 6.4\, the Perl 5.005 is the one from this distribution. Perl 5.6 is home-brewn.

Perl Info ``` Flags: category=core severity=medium Site configuration information for perl v5.6.0: Configured by ck at Thu Apr 6 18:08:57 MEST 2000. Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration: Platform: osname=linux, osvers=2.2.14, archname=i686-linux uname='linux fly.mydomain 2.2.14 #1 mon mar 13 10:54:26 gmt 2000 i686 unknown ' config_args='' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=define use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef Compiler: cc='cc', optimize='-O2', gccversion=2.95.2 19991024 (release) cppflags='-fno-strict-aliasing -I/usr/local/include' ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' stdchar='char', d_stdstdio=define, usevfork=false intsize=4, longsize=4, ptrsize=4, doublesize=8 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, usemymalloc=n, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt libc=, so=so, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' Locally applied patches: @INC for perl v5.6.0: /usr/local/lib/perl5/5.6.0/i686-linux /usr/local/lib/perl5/5.6.0 /usr/local/lib/perl5/site_perl/5.6.0/i686-linux /usr/local/lib/perl5/site_perl/5.6.0 /usr/local/lib/perl5/site_perl . Environment for perl v5.6.0: HOME=/home/ck LANG=german LANGUAGE (unset) LC_MESSAGES=de_DE LD_LIBRARY_PATH=/opt/kde/lib:/opt/kde2/lib LOGDIR (unset) PATH=/usr/bin:/usr/X11R6/bin:/bin:/usr/local/bin::/usr/lib/java/bin:/usr/games/bin:/usr/games:/opt/gnome/bin:/opt/kde/bin:. PERL_BADLANG (unset) SHELL=/bin/bash ```
p5pRT commented 21 years ago

From The RT System itself

fixed in perl 5.7.0\, probably will be fixed in perl 5.6.1