Db_DataObject - how to force connection to be utf8?

From: Date: Tue, 09 Aug 2005 15:32:00 +0000
Subject: Db_DataObject - how to force connection to be utf8?
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-20337@lists.php.net to get a copy of this message
Hi I'm using Db_DataObject (latest version) for a project (along with PHP 5.03 and MySQl 4.1) and the database tables (which of course map to Db_DataObject objects) I'm using are all in unicode (i.e.utf8) and currently some characters (e.g. curly quotes) being read from the database fields are not being displayed correctly on the web page, though the web page is set to display utf8 (and the browser recognises this). I'm presuming this is because the database *connection* also needs to set to utf8 - normally I would just do this using an SQL command after making the connection, i.e. SET NAMES 'utf8'; However, I can't see how this is possible using DB_DataObject, since the whle database connection thing is abstracted out. I thought there might be a Db_Database configuration option to set the character set for the connection, but there doesn't appear to be one. Does anyone have any tips for how to force the connection to be utf-8 when using Db_DataObject? Thanks Paul -- *+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+* Paul Groves paul.groves@oucs.ox.ac.uk Senior Project Officer, Academic Computing Development Team www.oucs.ox.ac.uk/acdt/ ACDT is part of the Learning Technologies Group www.oucs.ox.ac.uk/ltg/ Oxford University Computing Services | University of Oxford | 13 Banbury Road | Oxford OX2 6NN | Tel: 01865 273290 *+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*

« previous php.pear.general (#20337) next »