Skip Menu |

This queue is for tickets about the Wx CPAN distribution.

Report information
The Basics
Id: 83110
Status: open
Priority: 0/
Queue: Wx

People
Owner: Nobody in particular
Requestors: CHORNY [...] cpan.org
TAUNGER [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Wx 2.9 manipulates locale
at least the LC_NUMERIC setting test case: ############################ use 5.12.0; use warnings; say 8.3; require Alien::wxWidgets; say 8.3; require Wx; say 8.3; ############################ output: ############ 8.3 8.3 8,3 ############ As you can see, after including the Wx-Module, the setting changed. It does not only affect perl self. I found this error after i searched the reason for wired DBD::SQLite output. A call to POSIX::setlocale( LC_NUMERIC, 'C' ) can revert this, but i can not predict the consequences. --------------------- OS: Win7 64 $Wx::VERSION: 0,9916 Wx::wxVERSION: 2,009004 Perl -V: Summary of my perl5 (revision 5 version 16 subversion 1) configuration: Platform: osname=MSWin32, osvers=4.0, archname=MSWin32-x64-multi-thread uname='Win32 strawberry-perl 5.16.1.1 #1 Thu Aug 9 07:49:27 2012 x64' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags =' -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_ SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -mms-bi tfields', optimize='-s -O2', cppflags='-DWIN32' ccversion='', gccversion='4.6.3', gccosandvers='' intsize=4, longsize=4, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='long long', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='g++', ldflags ='-s -L"C:\strawberry\5-16-1-64\perl\lib\CORE" -L"C:\straw berry\5-16-1-64\c\lib"' libpth=C:\strawberry\5-16-1-64\c\lib C:\strawberry\5-16-1-64\c\x86_64-w64-mi ngw32\lib libs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32 perllibs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladva pi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lver sion -lodbc32 -lodbccp32 -lcomctl32 libc=, so=dll, useshrplib=true, libperl=libperl516.a gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-mdll -s -L"C:\strawberry\5-16-1-64\perl\lib\CORE " -L"C:\strawberry\5-16-1-64\c\lib"' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES HAVE_INTERP_INTERN MULTIPLICITY PERLIO_LAYERS PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP PERL_PRESERVE_IVUV PL_OP_SLAB_ALLOC USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF Built under MSWin32 Compiled at Aug 9 2012 07:55:51 %ENV: PERL_BASE="5-16-1-64" PERL_EXE="C:\strawberry\5-16-1-64\perl\bin\perl.exe" @INC: C:/strawberry/5-16-1-64/perl/site/lib C:/strawberry/5-16-1-64/perl/vendor/lib C:/strawberry/5-16-1-64/perl/lib . --- on an "old" perl (5.14) with Wx 2.8 everything seems fine
Hi, The difference is, as you suggest, that wxWidgets 2.9.x now sets the application locale on start-up to the user's current locale. It does this by calling the C library setlocale() function as setlocale(LC_ALL, ""); After reading through perllocale I have the opinion that your solutionis the correct one if you don't want locale formatting for numbers. So, use POSIX qw( setlocale, LC_NUMERIC ); ....... my $app = My::Wx::AppClass->new; setlocale(LC_NUMERIC, 'C'); $app->MainLoop; Perl more or less ignores locale settings if you don't 'use locale', but calling setlocale() affects the basic C library printf and sprintf functions so a setlocale(LC_NUMERIC, 'C') would seem to be required. I'm not really sure if this should be built in to the Wx startup code. Any opinions considered. On Sun Feb 03 09:23:08 2013, TAUNGER wrote: Show quoted text
> at least the LC_NUMERIC setting > > test case: > > ############################ > use 5.12.0; > use warnings; > > say 8.3; > > require Alien::wxWidgets; > > say 8.3; > > require Wx; > > say 8.3; > > ############################ > > output: > > ############ > 8.3 > 8.3 > 8,3 > ############ > > As you can see, after including the Wx-Module, the setting changed. > > It does not only affect perl self. I found this error after i searched > the reason for wired DBD::SQLite output. > > A call to POSIX::setlocale( LC_NUMERIC, 'C' ) can revert this, but i
can Show quoted text
> not predict the consequences. > > --------------------- > > OS: Win7 64 > > $Wx::VERSION: 0,9916 > Wx::wxVERSION: 2,009004 > > Perl -V: > > Summary of my perl5 (revision 5 version 16 subversion 1)
configuration: Show quoted text
> > Platform: > osname=MSWin32, osvers=4.0, archname=MSWin32-x64-multi-thread > uname='Win32 strawberry-perl 5.16.1.1 #1 Thu Aug 9 07:49:27 2012
x64' Show quoted text
> config_args='undef' > hint=recommended, useposix=true, d_sigaction=undef > useithreads=define, usemultiplicity=define > useperlio=define, d_sfio=undef, uselargefiles=define,
usesocks=undef Show quoted text
> use64bitint=define, use64bitall=undef, uselongdouble=undef > usemymalloc=n, bincompat5005=undef > Compiler: > cc='gcc', ccflags =' -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE > -DPERL_TEXTMODE_ > SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-
aliasing Show quoted text
> -mms-bi > tfields', > optimize='-s -O2', > cppflags='-DWIN32' > ccversion='', gccversion='4.6.3', gccosandvers='' > intsize=4, longsize=4, ptrsize=8, doublesize=8, byteorder=12345678 > d_longlong=define, longlongsize=8, d_longdbl=define,
longdblsize=12 Show quoted text
> ivtype='long long', ivsize=8, nvtype='double', nvsize=8,
Off_t='long Show quoted text
> long', > lseeksize=8 > alignbytes=8, prototype=define > Linker and Libraries: > ld='g++', ldflags ='-s -L"C:\strawberry\5-16-1-64\perl\lib\CORE" > -L"C:\straw > berry\5-16-1-64\c\lib"' > libpth=C:\strawberry\5-16-1-64\c\lib > C:\strawberry\5-16-1-64\c\x86_64-w64-mi > ngw32\lib > libs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 > -ladvapi32 > -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm > -lversion > -lodbc32 -lodbccp32 -lcomctl32 > perllibs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool > -lcomdlg32 -ladva > pi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr > -lwinmm -lver > sion -lodbc32 -lodbccp32 -lcomctl32 > libc=, so=dll, useshrplib=true, libperl=libperl516.a > gnulibc_version='' > Dynamic Linking: > dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' > cccdlflags=' ', lddlflags='-mdll -s > -L"C:\strawberry\5-16-1-64\perl\lib\CORE > " -L"C:\strawberry\5-16-1-64\c\lib"' > > > Characteristics of this binary (from libperl): > Compile-time options: HAS_TIMES HAVE_INTERP_INTERN MULTIPLICITY > PERLIO_LAYERS PERL_DONT_CREATE_GVSV > PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS > PERL_MALLOC_WRAP PERL_PRESERVE_IVUV
PL_OP_SLAB_ALLOC Show quoted text
> USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES > USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE > USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF > Built under MSWin32 > Compiled at Aug 9 2012 07:55:51 > %ENV: > PERL_BASE="5-16-1-64" > PERL_EXE="C:\strawberry\5-16-1-64\perl\bin\perl.exe" > @INC: > C:/strawberry/5-16-1-64/perl/site/lib > C:/strawberry/5-16-1-64/perl/vendor/lib > C:/strawberry/5-16-1-64/perl/lib > . > > --- > > on an "old" perl (5.14) with Wx 2.8 everything seems fine > > >
Hi Mark, i've installed the new Version (0.9917) and done some tests. The numbers behave again like in 2.8. From my point of view, everything seems fine now. I think this ticket can be closed. Many thanks for the fast and competent help! Best Regards, Tarek
I have same problem with Debian, Russian locale. Output is 8.3 8.3 8,3 This causes problems for Padre installation: http://padre.perlide.org/trac/ticket/1512 -- Alexandr Ciornii, http://chorny.net
On Tue Feb 05 02:39:58 2013, MDOOTSON wrote: Show quoted text
> The difference is, as you suggest, that wxWidgets 2.9.x now sets the > application locale on start-up to the user's current locale. > It does this by calling the C library setlocale() function as > setlocale(LC_ALL, "");
Just FYI, this is not the case with wxWidgets 3.0.0 any more (it was indeed done experimentally in 2.9 but rolled back because of various problems, such as the one reported here). So just making a new release of wxPerl using wx 3.0.0 should fix this.