Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:57913 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16602 invoked from network); 21 Feb 2012 11:37:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Feb 2012 11:37:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes.schlueter@oracle.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes.schlueter@oracle.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain oracle.com from 148.87.113.117 cause and error) X-PHP-List-Original-Sender: johannes.schlueter@oracle.com X-Host-Fingerprint: 148.87.113.117 rcsinet15.oracle.com Received: from [148.87.113.117] ([148.87.113.117:33685] helo=rcsinet15.oracle.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8E/C3-11208-702834F4 for ; Tue, 21 Feb 2012 06:37:44 -0500 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q1LBbdoD002368 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 21 Feb 2012 11:37:40 GMT Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q1LBbc7x024486 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 21 Feb 2012 11:37:39 GMT Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q1LBbbUo000651; Tue, 21 Feb 2012 05:37:38 -0600 Received: from [192.168.2.230] (/188.174.43.92) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 21 Feb 2012 03:37:36 -0800 To: Daniel Convissor Cc: PHP Internals List , Ulf Wendel In-Reply-To: <20120217133811.GA17442@panix.com> References: <20111118210619.GA13490@panix.com> <1326977447.2722.10.camel@guybrush> <20120121133107.GA7255@panix.com> <1327311604.5972.51.camel@guybrush> <20120124025600.GA337@panix.com> <20120217133811.GA17442@panix.com> Content-Type: text/plain; charset="UTF-8" Organization: Oracle Corporation Date: Tue, 21 Feb 2012 12:37:34 +0100 Message-ID: <1329824254.22794.16.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-CT-RefId: str=0001.0A090204.4F438204.009C,ss=1,re=0.000,fgs=0 Subject: Re: [PHP-DEV] mysqli_fetch_field() mysqlnd & libmysql differences From: johannes.schlueter@oracle.com (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Fri, 2012-02-17 at 08:38 -0500, Daniel Convissor wrote: > > A related problem was found by the test script. libmysql is completely > > ignoring the character set information in my.cnf. Plus, if one forces a > > character set by calling options(SET NAMES utf8) before connecting, > > character_set_name() still returns unexpected information. > > > > Can you please take a look at this test script: > > http://www.analysisandsolutions.com/php/libmysql.ignoring.character.set.php > > Can one of you please examine why libmysql is not acting as documented > and reply here in the near future? In my tests it worked like I expect: - the initial charset is the one configured - changing the charset affects the behavior Mind two things: 1) You said * /etc/my.cnf settings are (no other my.cnf files exist): * + default-character-set = utf8 * + character-set-server = utf8 In which section of the my.cnf file? Both for the server, or for the client? 2) SET NAMES changes the setting on the server. The client won't know about this and still assume the old charset was used. Use mysqli_set_charset(). In summary: charsets and encoding are a mess, especially if you have many places to configure those. One small oversight and all is messed. As reference: http://dev.mysql.com/doc/refman/5.5/en/charset-configuration.html johannes > Thanks, > > --Dan > > -- > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > data intensive web and database programming > http://www.AnalysisAndSolutions.com/ > 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 >