[Ipe-discuss] Ubuntu 9.04 and Ipe 6: SOLVED!!!

Otfried Cheong otfried at ipe.airpost.net
Wed Apr 29 22:51:27 CEST 2009


> 2009/4/29 Dietmar Winkler <Dietmar.Winkler at tu-berlin.de>:
>> On my virtual machine I was using english (C) as language and Ipe runs
>> fine. Now on the native installation I use another language and this
>> seems to be the problem. 

Okay, I understand now what happens.

Ipe relies on a number of standard ANSI C function to parse strings like 
"0.875".  These ANSI C functions suddenly became locale sensitive, and 
didn't work anymore about a year ago.  Since there do not seem to be any 
ANSI C functions for locale-independent formatting and parsing, the 
solution was to add the line

    setlocale(LC_NUMERIC, "C");

at the start of the Ipe program (this happened in version pre31).

However, now Qt 4.5 has somehow decided that it was a smart thing for Qt 
to set the locale itself, and it resets it back to what you had originally.

The new solution is to move the setlocale line to after QApplication has 
been created in main.cpp.   I will be releasing a new bugfix release 
that does this.  In the meantime, you can use Dietmar's fix.

A better solution would be to use locale-agnostic functions for 
formatting and parsing integers.  Unfortunately, there do not appear to 
be such functions in ANSI C.   There are some in glib, but I don't 
really want to introduce a dependency on gnome in the windows version of 
Ipe...   I'd be happy to hear any suggestions on how one is supposed to 
do this properly.

Cheers,
  Otfried





More information about the Ipe-discuss mailing list