I need a bit of help understanding how utf8 data is supposed to look when stored inside the database.
I'm using mysql and php, the database is set to utf8, the collation on the column "p_name" is set to "utf8_unicode_ci".
When I insert the data I pass it through this function
function convert_charset($in_str)
{
$cur_encoding = mb_detect_encoding($in_str) ;
if($cur_encoding == "UTF-8" && mb_check_encoding($in_str,"UTF-8"))
return $in_str;
else
return utf8_encode($in_str);
}
then insert it into the database. When I read out the data in php and display it in the browser i am using utf8 in the page, and the data displays right, however I'm suspecting something might be wrong.
Take the FRENCH word éditez
that's how it's supposed to look. However inside my database when I look at it the same word is being stored as éditez
. Is this right? Is this how mysql is supposed to store that word, or have I got something set wrong?
Here's what I have set already:
- php.ini --> set to utf8
- database --> set to utf8
- table column --> set to utf8_unicode_ci
- html pages --> set to utf8.