0

when I insert data into mysql database Serbian letter like č looks like Ä and ć looks like ć. In header I have:

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

and encoding is set to utf8_unicode_ci so I don't know where is the problem...

When I put

mysqli_set_charset($connection, "utf8");

before insert, then in mysql is looking good, but in my app ć is appear as symbol ?

Where am I wrong?

shone83
  • 23
  • 1
  • 8
  • @Mario `utf8_unicode_ci` would suffice. As for Shone83, please provide a [mcve] because we cannot verify. – Xorifelse Mar 06 '17 at 23:50
  • Set collation and column collation to `utf8_bin` and remove this line of code `mysqli_set_charset($connection, "utf8");` This is working for me on localhost and on live server for ćčšžđ. – Mario Mar 07 '17 at 00:01
  • I try to set to utf8_bin, check Change all column collations and delete code but the result are the same... – shone83 Mar 07 '17 at 00:10
  • Do you maybe have some function to insert data into database ? – Mario Mar 07 '17 at 00:21
  • No, just like this: $query = "INSERT INTO anketa(ime, prezime, jmbg, telefon1, telefon2, email) "; $query .= "VALUES('{$ime}', '{$prezime}', '{$jmbg}', '{$telefon1}', '{$telefon2}', '{$email}')"; – shone83 Mar 07 '17 at 00:29
  • See "Mojibake" in http://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored – Rick James Mar 07 '17 at 02:46

0 Answers0