This is a discussion on Charset problem, Data from mysql appear wrongly within the PHP Language forums, part of the PHP Programming Forums category; Hello I have build an application with php/mysql on my localhost Windows XP (english) My application lets you select ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello
I have build an application with php/mysql on my localhost Windows XP (english) My application lets you select the language which at the moment is Greek and English. My application is working fine on both languages but when i uploaded it to a remote server greek doesn't work. Actually the greek that are stored in the DB come up wrongly. I have read many other posts regarding this problem and i have tried many things but none works. First of all, i have checked that both mysql servers have the same character_set and character_set variables, so the remote DB supports Greek. Here is the code that initializes the DBConnection $DBLink = mysql_connect($DBHostIP,$DBUserName,$DBPassword) or die ("Could not connect on MySql Database"); mysql_select_db("sarafian_Agenda") or die("Could not select database"); which resides in a function. This was the original code with which only on my server worked in conjuction with the correct character set in the header part of the produced html Having read some articles i decided to try this code in the function $DBLink = mysql_connect($DBHostIP,$DBUserName,$DBPassword) or die ("Could not connect on MySql Database"); mysql_select_db("sarafian_Agenda") or die("Could not select database"); mysql_query("SET NAMES 'iso-8859-7'",$DBLink); ini_set('mbstring.internal_encoding','iso-8859-7'); ini_set('mbstring.http_input','iso-8859-7'); ini_set('mbstring.http_output','iso-8859-7'); ini_set('mbstring.internal_encoding','iso-8859-7'); header("Content-type: text/html;charset=iso-8859-7"); iso-8859-7 is the charcter set for greek. I have tried various combinations for the iso-8859-7 with utf-8 but i had no luck. I really cant understand the problem. The curious thing is that phpMyAdmin presents the data correctly. I have tried tracking down how it does it without succes. Both databases are above the 40010 version that phpadmin checks. Thank you very much |