Re: utf8 charset comunication PHP5 -> MySQL4.1 IMPOSSIBLE!
Posted by: Shuichi Tamagawa
Date: September 09, 2005 02:56PM


> I have changed EVERYTHING to utf-8 charset:


> [mysql]


This works only for 'mysql' command line client in bin directory, and does not work for the client library that your PHP program use.

Check the result of 'SHOW VARIABLES LIKE 'char%' from your program. The value of the client character set variables such as:


would be 'latin1' because the default character set of the client library is 'latin1' unless you compile it from source using '--with-charset=character_set_name'.

To change the character set of the client library, you can do one of the followings:

1. execute 'SET NAMES utf8' everytime after connecting to the database
2. add init_connect='SET NAMES utf8' in [mysqld] part of my.cnf
3. compile mysql from source using --with-charset=utf8 and have your PHP to use the client library.

Hope it helps.



Options: ReplyQuote

Written By
Re: utf8 charset comunication PHP5 -> MySQL4.1 IMPOSSIBLE!
September 09, 2005 02:56PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.