i have an array who contain french character ( à , é ex: [5] => 2 c à s d’huile d’olive) , when i print the array , it display whell this characters , but when i save them on the mysql database , i face encoding issue , as in the database table it's become like this :

a:6:{i:0;s:473:"facile à réaliser .....

even more strange , the title of the post contain special character and it displays correctly, and the problem affect only the data in wp_postmeta table.

bellow my wp-config.php config:

define('DB_CHARSET', 'utf8mb4');
define('DB_COLLATE', '');

any idea please

  • i just notice that this issue concern only custom fields of the custom post type and not the the title or the content of the custom post type , i use update_post_meta function to insert data into custom fields. – alpha.romeo Feb 25 at 15:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.