GetValue(), floats, and locales
| От | Jeroen T. Vermeulen |
|---|---|
| Тема | GetValue(), floats, and locales |
| Дата | |
| Msg-id | 20030507133633.GD48885@xs4all.nl обсуждение |
| Ответы |
Re: GetValue(), floats, and locales
|
| Список | pgsql-interfaces |
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
В списке pgsql-interfaces по дате отправления: