Chris Cris
Chris Cris

Reputation: 215

php file character encoding, mysql database character encoding, special characters

I've a mysql db with some special characters, an input form, some php pages.


RequestPage is encoded as utf-8 through

ResultsPage is encoded as utf-8 through

The database and its tables are encoded as utf8_general_ci.


Now, for instance:

Any suggestion?

Upvotes: 1

Views: 169

Answers (1)

Chris Cris
Chris Cris

Reputation: 215

I've solved the problem with this string added in the php resultsPage file:

mysql_query("SET character_set_results = 'utf8', character_set_client='utf8', character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8'", $connection);

Obviously it has to be inserted after this string:

$connection = mysql_connect($servername,$username,$dbpassword);

Upvotes: 1

Related Questions