[fdo-users] FDO SHP + dotNet help : managing the decimal separator

Ytse bill_gfr at yahoo.fr
Wed Nov 7 12:29:49 EST 2007

I'm using FDO 3.2.2 + C# for ASP.NET 2.0

I know how to insert/update values in an existing SHP
file, here's roughly how I would insert a decimal
value on a property :

PropertyValue("myDouble", new DataValue(12.5,

That's ok, everything works fine.
It would, if the regional settings of my server were
set so that my decimal separator is ".", which is the
only valid character for the decimal value of a DBF
But I'm working on a french server with ",", and the
generated file has 12,5 in it, not 12.5, so it's being
considered invalid.

I've tried many things, but I can't eventually find a
way to get rid of this. I've tried :
- changing the current thread culture to en-US or
invariant (my default app culture is fr-FR)
- changing the culture of the refered OSGeo dlls in my
csproj file

It looks like the unmanaged FDO dlls use the regional
settings no matter what I can do : I've tried setting
some "stupid and easily noticable" character as the
server decimal separator, and it's this one that's
being used in the DBF file.

I already highlighted this matter something like 6
months or earlier, and I eventually decided to rewrite
and recompile RowData.cpp to add
setLocale(LC_NUMERIC,"C") on the constructor (and
restored in the destructor), but that was in my 3.2
Now I'm thinking of releasing my application with FDO
3.2.2 but rewriting and recompiling the whole thing
again probably isn't the good solution.

If anyone could help me find an alternate way, or if
this could definitely be considered a bug and properly
integrated in FDO (my solution works but is probably
not the best one), that would be great.

Thank you

Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail 

More information about the fdo-users mailing list