On 2009-09-01 12:08+0200 Werner Smekal wrote:

> Hi Alban,
>
> yes this [setting locale in qt] works.

Hi Werner:

Thanks very much for thinking of locale as a possibility for messing up
sscanf.  That was a stroke of debugging genius, and it is wonderful news
that we now have the reason for all the strange results you were getting
when attempting to read palette files.

However, I don't think the current solution (revision 10363) to this problem
is correct. Instead of forcing the C locale whenever we use qt, the user
should be allowed to use any locale they like for _user_ input to PLplot
regardless of device driver. Of course, our palette files absolutely require
setlocale(LC_NUMERIC, "C"); in order to be read properly as you have
discovered. Thus, I think our best solution to this whole issue is to save
the user locale, use setlocale(LC_NUMERIC, "C"); to read the file, then
restore the user locale in both cmap0_palette_read and plspal1.  This method
absolutely guards against any locale issue (say for a different library than
qt) ever again screwing up palette file reading so this is what I like.

What do you think of this idea?  If you agree, would you be willing to help
with the implementation and testing?  (I don't know how to get the current
locale [there appears to be no function called getlocale, although
localeconv might be a possibility on Linux], and we have to insure that
setlocale [and whatever you recommend for getting the current locale
information] works on all our platforms.)

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to