From: Jeroen T. Vermeulen <jtv@xs4all.nl>
To: pgsql-interfaces@postgresql.org
Subject: GetValue(), floats, and locales
Date: Wed, 7 May 2003 15:36:33 +0200
Message-ID: <20030507133633.GD48885@xs4all.nl> (raw)
I just got a bothersome bug report from a libpqxx user in Hungary (where,
as it turns out, floating-point numbers are written with decimal commas
rather than decimal points). It appears that libpq's GetValue() delivers
floating-point fields in localized format. The problem with this is that
libpqxx then tries to parse the numbers using sscanf(), which apparently
doesn't expect the number to have a decimal comma.
This begs the question: is it libpq that represents these values using the
client's locale, or does the server ship them in this form according to
its own locale? The former is fine but really needs (1) some standard
way to parse the localized numbers, or (2) a bypass to the more parsable
C-style representation. The latter would be just plain crazy AFAICS.
Jeroen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: jtv@xs4all.nl
Subject: Re: GetValue(), floats, and locales
In-Reply-To: <20030507133633.GD48885@xs4all.nl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox