Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:63171 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10369 invoked from network); 19 Sep 2012 18:36:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Sep 2012 18:36:02 -0000 Authentication-Results: pb1.pair.com header.from=lars@strojny.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=lars@strojny.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain strojny.net from 46.4.40.248 cause and error) X-PHP-List-Original-Sender: lars@strojny.net X-Host-Fingerprint: 46.4.40.248 milch.schokokeks.org Received: from [46.4.40.248] ([46.4.40.248:56101] helo=milch.schokokeks.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DB/A2-15057-0901A505 for ; Wed, 19 Sep 2012 14:36:01 -0400 Received: from [192.168.178.32] (ppp-188-174-24-197.dynamic.mnet-online.de [::ffff:188.174.24.197]) (AUTH: PLAIN lars@schokokeks.org, TLS: TLSv1/SSLv3,128bits,AES128-SHA) by milch.schokokeks.org with ESMTPSA; Wed, 19 Sep 2012 20:35:58 +0200 id 000000000000001A.00000000505A108E.000020B1 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Message-ID: <177BEC05-2944-441A-98FE-7A456061C4EE@strojny.net> Date: Wed, 19 Sep 2012 20:35:57 +0200 To: "internals@lists.php.net PHP internals" Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1486\)) X-Mailer: Apple Mail (2.1486) Subject: PR 186: external protocols and locale independent string conversion From: lars@strojny.net (Lars Strojny) Hi everybody, I'm currently working on https://github.com/php/php-src/pull/186, which = fixes a problem with PostgreSQL when passing a float to = pg_query_params() with a locale setting that uses "," as a decimal = point. pg_query_params() uses convert_to_string(), which uses %G as a = format string for floats, which is 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 Zend 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. = mysqlnd, 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 like 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? cu, Lars=