Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63183 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99800 invoked from network); 20 Sep 2012 08:02:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Sep 2012 08:02:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.170 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.210.170 mail-iy0-f170.google.com Received: from [209.85.210.170] ([209.85.210.170:59437] helo=mail-iy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 32/60-15057-D9DCA505 for ; Thu, 20 Sep 2012 04:02:38 -0400 Received: by iamm10 with SMTP id m10so1693889iam.29 for ; Thu, 20 Sep 2012 01:02:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=ts0d/JHCypTGfFe9ccUH4MRiuXcqjblSdBmCF4sSEWU=; b=NRmUEeA+ePrLE0JWsBxFM8yFpooTM0amUP2lRgzeZo6uy9BVTuMzDgmpoX+QYw5B63 if3Vx7CKFxerN7Ltq1EIseXeO19WEpYJnMl6ELCR+ux4delT8tyooaoww/lZTfdUi9Rc FQ5i1gmHS+Jx1N4kRrFyQ4Gdqrxg21tPNYFXgeOe1ylwIN6wHlcTeyRgCh8G0jPEBTPl JRqQdRheY0cP5YarGeEKHv1VZVM9GOaTUKJdALUXT0l/UcHlIn5ltFdnmzlkpP8zM6ey NuyT6hfRLWR4RdhG3uF3kKVLn62bjhy7xWyzLL9qxieawfAHRb7Xo8YucRgiAsW23ND/ vPyQ== MIME-Version: 1.0 Received: by 10.43.117.129 with SMTP id fm1mr818850icc.1.1348128155139; Thu, 20 Sep 2012 01:02:35 -0700 (PDT) Received: by 10.64.89.41 with HTTP; Thu, 20 Sep 2012 01:02:35 -0700 (PDT) In-Reply-To: <177BEC05-2944-441A-98FE-7A456061C4EE@strojny.net> References: <177BEC05-2944-441A-98FE-7A456061C4EE@strojny.net> Date: Thu, 20 Sep 2012 10:02:35 +0200 Message-ID: To: Lars Strojny Cc: "internals@lists.php.net PHP internals" Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] PR 186: external protocols and locale independent string conversion From: pierre.php@gmail.com (Pierre Joye) hi Lars, On Wed, Sep 19, 2012 at 8:35 PM, Lars Strojny wrote: > I'm currently working on https://github.com/php/php-src/pull/186, which f= ixes a problem with PostgreSQL when passing a float to pg_query_params() wi= th a locale setting that uses "," as a decimal point. pg_query_params() use= s convert_to_string(), which uses %G as a format string for floats, which i= s locale sensitive (and therefore converts e.g. in hr_HR or de_DE to "1,1")= . The proposed fix is to introduce a new API convert_to_cstring() in the Ze= nd Engine to allow converting types to C-locale strings. > > This kind of fix is very likely needed in other places, where floats are = converted using convert_to_string(). I haven=92t found time to try e.g. mys= qlnd, but I suspect we=92ll find similar issues there. I don=92t think the = proposed workaround of burden users with explicitly converting floats to a = numeric representation is a good solution and I think we should fix bugs li= ke that in places they occur. > > What=92s your take on the proposed fix of introducing convert_to_cstring(= ) and using it where external protocols require a locale insensitive float = conversion? To me it looks like it is not something we should try to solve. The application, database code (via connection options, queries, etc.) should take care of. About internals other usages, *printf functions allow to do what you suggest easily without adding yet another conversion function. Cheers, --=20 Pierre @pierrejoye