Windows and xslt dll

Miika Turkia miika.turkia at gmail.com
Wed Mar 6 05:44:38 PST 2013


On Wed, Mar 6, 2013 at 3:43 PM, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
> On 6 March 2013 15:05, Robert C. Helling <helling at lmu.de> wrote:
>> On Wed, 6 Mar 2013, Rainer Mohr wrote:
>>
>> Hi,
>>
>>
>>> So it would be best to not rely on the float values that the dll returns
>>> and instead parse the float from the XML yourself...
>>
>>
>> I don't know anything about Windows but I would assume that there is a
>> corresponding function that parses strings into floats using the current
>> locale (and one might think about using this in other places as well as
>> mentioned yesterday but this of course opens a whole new can of worms as
>> then the xml might become locale dependent etc).
>>
>
> it could be that XSLT uses strtod() internally, which is locale bound
> and not much can be done (unless we modify XSLT).
>
> glib has a g_ascii_strtod():
> https://developer.gnome.org/glib/2.28/glib-String-Utility-Functions.html#g-ascii-strtod
>
> but since the cylinder volume is stored in milliliters, it would be
> probably better to parse using:
>
> sscanf(buf, "%d.%d", &integral, &fraction)
> cyl.size.mliter = (integral * 1000) +  fraction.

This should do to magic. Please test.

miika
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-locale-originating-decimal-point-on-import.patch
Type: application/octet-stream
Size: 1318 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130306/51e26d81/attachment-0001.obj>


More information about the subsurface mailing list