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

ytse bill_gfr at yahoo.fr
Thu Nov 15 13:10:39 EST 2007

Dan Stoica wrote:
> Hmm, managed code calling unmanaged code... it might explain.
> In any case, here is what I suggest to do instead of setting the locale on
> the connection.
> In idea is that the provider should be able to figure out the
> correct/consistent string format for decimals. That is, given the LDID
> (see EsriCodePageMapper[] in ShapeDBF.h) you  can tell if the '.' or ','
> should be used. This would make the provider locale independent.
> Therefore:
> - on insert/update:  check the sprintf() return value. In case the
> delimiter is different from the correct one, do a substitution before
> writing to file.
> - on select: check atof() output. In case it's 0.0 and the input is not
> "0..." then we know we have a locale mismatch and perform a substitution
> '.' <-> ',' before trying atof() again.
> I believe this would work with no side effects.
> What do you think?
> Dan.
Well, I don't know if that would be the most efficient way of resolving the
issue (checking each decimal value vs forcing the locale once) but that
sounds more appropriate.
I actually don't know how to debug the FDO sources, I've just read the
sources up to this point (I don't know much about C++ => I'm able to read
the source and add a couple instructions here and there and recompile
everything but that's it, so I won't try your solution by myself)

If you (or someone else) could continue to help me this way I would really
appreciate it.

Thanks for your support anyway.
View this message in context: http://www.nabble.com/FDO-SHP-%2B-dotNet-help-%3A-managing-the-decimal-separator-tf4766129s18162.html#a13778124
Sent from the fdo-users mailing list archive at Nabble.com.

More information about the fdo-users mailing list