0

I have a character encoding problem with MySQL database. It's MySQL server 5.1.72 and PHP 5.3.28. In PHPMyAdmin, I have the following settings:

Server charset: UTF-8 Unicode (utf8)

Server connection collation: utf8_danish_ci

Database collation: utf8_danish_ci

Table collation: uft8_danish_ci

All fields in the table: utf8_danish_ci

Yet, if I do this:

$con = mysqli_connect( $dbhost, $dbuser, $dbpassword, $dbname );
mysqli_set_charset($con,"utf-8");
echo mysqli_character_set_name($con);

The output is "latin1". My problem is of course, that Danish characters are not displayed correctly.

OZ1SEJ
  • 399
  • 1
  • 5
  • 14
  • "Server connection collation: utf8_danish_ci" - so what is the server connection charset? – Danack Mar 10 '14 at 03:40
  • Hmm, how do I find out? ;-) – OZ1SEJ Mar 10 '14 at 07:08
  • Well how to set it is in here http://stackoverflow.com/questions/16858915/migrating-a-php-application-to-handle-utf-8/16862181#16862181 also via $mysqli->set_charset('utf8') – Danack Mar 10 '14 at 15:20

0 Answers0