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

Re: gEDA-user: PCB Gtk port



On Mon, Mar 07, 2005 at 07:15:13PM -0600, Bill Wilson wrote:
> On Tue, 8 Mar 2005 00:45:38 +0100 (CET)
> Tomasz Motylewski <T.Motylewski@xxxxxxx> wrote:
> 
> > > When editing and saving it takes into account locale.
> > > When reading files it doesn't.
> > > The effect: if you have decimal separator other than '.' (dot) you can
> > > save but you cannot load what you saved.
> > >
> > > Am I right?
> > 
> > Most probably yes. I had once reverse problem in gerbv - '.' was saved but in
> > many locales sscanf("%f"...) was insisting on having ','.
> > 
> > Fixed by setlocale(LC_NUMERIC, "C" ) in the affected function (parse_pnp()).
> > Because of some GTK magic calling it at the beginning of main() did not work.
> > 
> > If this is not the proper solution, I would be delighted to hear what is.
> 
> If you call setlocale(LC_NUMERIC, "C") at the beginning of main, you then
> also have to call gtk_disable_setlocale() before gtk_init() to prevent Gtk
> from undoing your LC_NUMERIC setting.


I'd prefer to have a file format which doesn't change based on locale.  
We should also check that, for example, the x-y (centroid) output file
is not corrupted since it uses a "," to seperate fields.

-Dan

--