setting character set for inserts and updates
Posted by: Attila Rákos
Date: December 16, 2005 04:21PM

Hi!

I have MySQL 4.1.15 (Win) with a utf-8 based database (default character set is utf8 on each table) and a PHP program working on it. Everything is perfect while the default-character-set option is set to utf8 in the configuration file (my.ini), but I have to install the program and the database on a server (Linux) where this setting is different. When I try to execute queries on this server from PHP, the result seems to be in ISO-8859-2 (latin2), which is not suitable for me (I need utf-8). After setting character_set_results variable to utf8 (SET character_set_results = utf8) the SELECTs work well, I get the result what I need. However the INSERTs and UPDATEs which contain text in utf-8 are apparently considered as ISO-8859-2 instead of utf-8. I tried to set character_set_connection, character_set_server, character_set_database and character_set_system to utf8 before executing INSERTs and UPDATEs but nothing happens. Do I miss something or the SQL commands really rely on the default-character-set option of my.ini/cfg by all means? It's unbelievable for me.

Thanks,

Attila

Options: ReplyQuote


Subject
Views
Written By
Posted
setting character set for inserts and updates
2897
December 16, 2005 04:21PM


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.