Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50107 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47173 invoked from network); 5 Nov 2010 13:26:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Nov 2010 13:26:52 -0000 Authentication-Results: pb1.pair.com header.from=jbondc@openmv.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=jbondc@openmv.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain openmv.com from 64.15.152.204 cause and error) X-PHP-List-Original-Sender: jbondc@openmv.com X-Host-Fingerprint: 64.15.152.204 mail.ca.gdesolutions.com Received: from [64.15.152.204] ([64.15.152.204:62260] helo=mail.ca.gdesolutions.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 01/10-46508-81604DC4 for ; Fri, 05 Nov 2010 08:26:50 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.ca.gdesolutions.com (Postfix) with ESMTP id 6D75A5D18; Fri, 5 Nov 2010 09:26:46 -0400 (EDT) X-Virus-Scanned: amavisd-new at gdesolutions.com Received: from mail.ca.gdesolutions.com ([127.0.0.1]) by localhost (mail.ca.gdesolutions.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eyTFQBDuHa7E; Fri, 5 Nov 2010 09:26:46 -0400 (EDT) Received: from djbondc (modemcable083.208-56-74.mc.videotron.ca [74.56.208.83]) by mail.ca.gdesolutions.com (Postfix) with ESMTP id E69C95D16; Fri, 5 Nov 2010 09:26:45 -0400 (EDT) To: "'Stanley Sufficool'" Cc: References: <24c7fdf08ac80c097306908d0c4b5512.squirrel@www.l-i-e.com> In-Reply-To: Date: Fri, 5 Nov 2010 09:26:45 -0400 Message-ID: <006101cb7ced$17dc5480$4794fd80$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Act8phueZiX9KnKaT3OcUrgb/Gy4hgAMwxQg Content-Language: en-ca Subject: RE: [PHP-DEV] PDO_DBLIB Native PHP Type binding From: jbondc@openmv.com ("Jonathan Bond-Caron") On Fri Nov 5 12:57 AM, Stanley Sufficool wrote: > > > > And why is PHP client library using latin1 for data that just isn't=20 > > latin1? =A0That's just asking for problems... >=20 > Theoretically I could ask for UTF8, but then I don't want to have to=20 > run utf8_decode/utf8_encode on all query strings, returned data, etc=20 > when the other drivers do not return unicode to PHP. >=20 Have a look at: https://open-mv.googlecode.com/svn/trunk/classes/database/drivers/ I've solved most of these problems though not with PDO* drivers. I think you'll get the consistency you need for "2 interchangeable and = have PHP/PDO applications run the same on Win32 and Linux" only minus the PDO/PDO_DBLIB part. In my opinion, PDO already does too much "abstraction magic", it would = be great if PDO2? could expose somehow: static inline void fetch_value() so that in userland you could deal with custom data types and override = how the data type bindings happen. That would be some much needed flexibility to actually create a = "database abstraction" layer vs the pdo "data-access" layer. > > > > My only answer to that is to change your code to not ask for = 'latin1' > > in the first place, when the data isn't latin1. =A0Change the PHP > client > > charset to what it ought to be, and get the data you wanted, not=20 > > some lossy down-sampled useless conversion of the data you wanted. > > > > I cannot comment on SQL Server behaviour with respect to the=20 > > "servers code page" [sic], whatever that is, except to say that=20 > > MySQL lets you define your charset on a table by table basis, and, I = > > think, in > recent > > versions, even on a field by field basis. OpenSource ftw, perhaps?=20 > > :- > ) >=20 > MSSQL allows per table and per column code pages in recent versions. > As far as OpenSource DBMS', I support what my clients run, not what I=20 > want them to run. If I had my choice, I would be running PostgreSQL. >=20 Per column code pages / collation is actually part of SQL92 (postgresql doesn't support it, mysql, mssql,.. does) In windows, the SQL native driver will properly convert everything to = UTF-8. In unix, FreeTDS should do the conversion correctly, have you run into problems? Is this related to the PDO driver?