Re: Locale definitions, dots and commas
- From: "Martin (OpenGeoMap)" <martin opengeomap org>
- To: Carlos Pereira <jose carlos pereira ist utl pt>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Locale definitions, dots and commas
- Date: Thu, 13 Mar 2008 16:33:58 +0100
Hi:
If I follow Martin's suggestion, inserting gtk_disable_setlocale ()
before gtk_init (), everything is consistent and works fine, XML
importing/exporting, GTK interfaces, etc. I just tested it.
Unfortunately this means always using dot-based decimals. I always
use dots myself, so this is not an issue for me. But I understand that
other people might wish to use commas instead.
I think the ideal solution is: when importing files, accept both
dots and commas, so for example this XML line should be acceptable:
<element x="1.0" y=2,0"/>
In engineering we use english decimal separator always, but it´s perfect
both support.
I am using PCRE and works fine with this. You can combine XMLlib with pcre.
Internally in the gtktreeview for example we want see always dots.
In .NET this problem is solved thanks to globalization library, but in
visual basic 6 this problem have a dificult solution. Many people in
visual basic 6 change the windows unit system when the app begin and
restart the initial configuration when the program end.
PCRE is use nowadays in GLIB i think, but it´s a PERL 5 regular
expresion compatible library used in .NET, JAVA, python, php,...
I am building an intermediate unit system for engineeres in Gobject and
i hope publish this library soon.
With this system you always work in lineal measures in meters (double),
and you can input others (inches, centimeters)
input system - intermediate system -out system
you can input in a entry for example (22m, 22 m, 220cm,...) and
internally you have a double always in meters.
I have other system to angles, and so...
In a external file you have the units and the decimal separators amount.
for example in Spain you see:
23.345 m
45 g 34 c 34.456 cc
, but other could be:
23.2 m
45º 34' 23.23''
,
or
234.34564 in
2345 s (degree angular seconds)
It´s PCRE which process this text (22in, 22 m 2º3'23.34'',
35g23c34.45cc,...)
http://www.pcre.org/
In KOMODO IDE you can create your expresion in a easy way ;-)
Pd:
I see many engineeres fans here of GTK. We can share many thinks...
Regards.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]