Re: PHP 6: Mysql with iso-8859-1 chars outputting utf-8: "Could not convert binary string to Unicode string"

From: Date: Thu, 03 May 2007 04:04:28 +0000
Subject: Re: PHP 6: Mysql with iso-8859-1 chars outputting utf-8: "Could not convert binary string to Unicode string"
References: 1 2  Groups: php.i18n 
Request: Send a blank email to php-i18n+get-1064@lists.php.net to get a copy of this message
Andrei Zmievski wrote: > Georg, > > Can you look into this? > > -Andrei > Hi!, >> >> mysql_query('set names latin1', $this->mysql_link); That doesn't work when unicode.semantics is on. When running with unicode.semantics=on mysql extension expects data from server in utf8. >> >> mysql_query('set names utf8', $this->mysql_link); You don't need to do that, after calling mysql_connect the utf8 character set will be set by default. >> >> it works, but I would like to keep compatibility with PHP 5, and for >> my application it requires set names to be latin1. Also, my databases >> are not created with the "utf8" option. MySQL Server takes care of the conversion, so if your tables are in latin1, and default character set is utf8 data will be converted on server side. /Georg -- Georg Richter, Development Manager - Connectors & Client Connectivity MySQL GmbH, Radlkoferstr. 2, D-81373 München, www.mysql.com Geschäftsführer: Hans von Bell, Kaj Arnö - HRB München 162140

« previous php.i18n (#1064) next »