locale setting with .so

From: Kyle Kolander (kkolander_at_hotmail.com)
Date: 05/26/05


Date: Thu, 26 May 2005 12:16:26 -0500

We have a problem with output from streams with numeric types:

// proper includes and additional code here
int x = 2552123;
cout << x;

This results in output like this: 2,552,123
Same behavior with stringstreams.

I am pretty certain this is due to locale settings...

This only happens when we link with shared library files (.so), the static
libraries (.a) work fine.

In main() the output is correct "2552123", but inside of our class source
files, it is "2,552,123".
Something must be setting the locale betwen that time.

I was referred here from comp.lang.c++ as we are developing on AIX with
Visual Age 6.0.

Any insights/suggestions what could be happening here? How could we be
getting different
locale settings with a .so file than with a .a file when both are built with
the same code.

Thanks,
Kyle



Relevant Pages

  • locale setting with .so
    ... cout << x; ... I am pretty certain this is due to locale settings... ... This only happens when we link with shared library files, ... Something must be setting the locale betwen that time. ...
    (comp.unix.aix)
  • Re: Ubuntu magic (Karl Larsen)
    ... Locale settings ... How and where can I add a short version of "exit"? ... Have a friend who uses Windows but wants to use Linux. ...
    (Ubuntu)
  • Re: process versus thread
    ... | The locale information is maintained per process, ... | although the script itself never called setlocaleitself. ... windows uses apartment-model threading, where one process is spawned and can ... different settings than another renter...however, different from real life, ...
    (alt.php)
  • Re: Why are there locale troubles under Windows?
    ... of the same process at the same time changing the processwide locale ... thread will have indipendent locale settings_. ... How is PHP supposed to react when someone on the server changes the locale ...
    (comp.lang.php)
  • DataSet Locale problem
    ... if the regional language settings are changed at the point of where I ... Constraint that has different Locale or CaseSensitive settings between its ... All state that the locale is "English " ...
    (microsoft.public.dotnet.languages.vb)