[fityk-devel] GSOC xylib - locale issue

3 views
Skip to first unread message

Marcin Wojdyr

unread,
Jul 13, 2007, 1:44:56 AM7/13/07
to fityk...@lists.sourceforge.net, 张鹏
A few weeks ago we discussed with Zhang endiannes issue. There is
another portability issue -- format of floating point numbers depends
on locale settings.
If we have line in Rigaku format:
*STEP = 0.0200
the number won't be properly read with some LC_NUMERIC settings.
In fityk, I just set LC_NUMERIC at the beginning of program. Python
has internal functions - locale-independent string <-> double
conversion, that uses libc functions, and than changes decimal point,
if needed. In SQLite AFAIK there are locale-independent functions that
don't use libc functions.

Saying that, I think this problem can be ignored - it's enough if it
is mentioned in docs that library doesn't work with locale settings
that have decimal point different than dot.

--
Marcin Wojdyr | http://www.unipress.waw.pl/~wojdyr/

Reply all
Reply to author
Forward
0 new messages