Re: PR 186: external protocols and locale independent string conversion
| From: | Alec Smecher | Date: | Sat, 27 Oct 2012 00:01:08 +0000 |
| Subject: | Re: PR 186: external protocols and locale independent string conversion | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-63660@lists.php.net to get a copy of this message | ||
On 26/09/12 04:02 PM, Alec Smecher wrote:
On 20/09/12 12:02 PM, Alec Smecher wrote:Thanks, AlecIt looks to me like a textbook use case of pg_query_params will currently fail depending on what locale is being used. What Claude at <https://bugs.php.net/bug.php?id=46408#1334753071> and Lars here are trying to do is make it a general fix, which is good -- but the problem is best exemplified IMO by the above snippet. The work-around suggested by jani@php.net (https://bugs.php.net/bug.php?id=46408#1227272959) illustrates further: $oldLocale = setlocale(LC_NUMERIC, 'C'); pg_query_params($conn, 'INSERT INTO myTable (myColumn) values ($1)', array(3.5)); setlocale(LC_NUMERIC, $oldLocale); That's an example of a work-around for a broken API in my opinion.Ping. Any feedback on this? Excuse my persistence. There must be a fix for this at the PHP level that's palatable to you folks...