Re: [gtkmm] behavior modification of input/output functions



Thank you for your advice !

I have added the code 'setlocale(LC_ALL, "C");' just after 'Gtk::Main
m(&argc, &argv);' and all the numbers are well parsed.

Does gtkmm initialize the language to the local setting ?

Le mer 21/07/2004 à 07:47, Tassos Bassoukos a écrit :
> On Tue, 2004-07-20 at 20:38, Florent Teichteil wrote:
> [snip]
> > 1) First test with 3.56 :
> > 
> > p = 3.56
> > p = 3,000000
> > 
> > 2) Second test with 3,56 :
> > 
> > p = 3,56
> > p = 3,560000
> > 
> > I was very surprised since I should obtain the opposite result.
> >
> > Indeed, the same piece of code in a console application returns the
> > opposite results :
> > 
> > 1) First test with 3.56 :
> > 
> > p = 3.56
> > p = 3.560000
> > 
> > 
> > 2) Second test with 3,56 :
> > 
> > p = 3,56
> > p = 3,000000
> > 
> > Therefore, I think that gtkmm modifies the behavior of the functions of
> > <cstdio>. If so, how can I prevent this modification ?
> [snip]
> 
> You should check the locales (using the locale command) on the console
> and on the terminal. You will probably find out that you have different
> locales set, which will modify the way the numbers are parsed.
> 
> Tassos




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]