0

Hi community i need your help.

I have find a problem that i don't know how to solve. The fact is that i'm getting information about posts from facebook pages. And all works fine until the doomed santa's come to the party.

I explain myself, i need to store the following text in the database:

LLEGA LA NAVIDAD A LA DIPU

Papá Noel, el Rey Gaspar y los personajes infantiles más famosos de la tele son algunos de los protagonistas de nuestra 'Navidad en la Dipu'. Hasta el 5 de enero puedes disfrutar además de talleres infantiles, actuaciones musicales, nuestro gran Mercado Artesanal y muchas sorpresas más #NavidadEnLaDipu

Aquí te dejamos toda la programación ➡️ 'link'

and when i try to store it. i have the following error:

error image

I'm encoding the database with this charset as i saw that was recommended for this cases

  CREATE SCHEMA IF NOT EXISTS `mydb` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
USE `mydb` ;

All the help is welcome. I don't know what to do.

2 Answers2

0

I needed to change not only de database. These things too:

SET character_set_client = utf8mb4;
SET character_set_results = utf8mb4;
SET character_set_connection = utf8mb4;
SET character_set_server = utf8mb4;

To see if you have these variables well changed use

show variables;

0

Please provide SELECT HEX(col) ... to help debug things. is F09F8E85 F09F8FBC in utf8mb4. ➡️ is E29EA1 EFB88F.

CREATE SCHEMA .. DEFAULT CHARACTER SET only provides the DEFAULT. Let's see SHOW CREATE TABLE ... to see what you actually have for the column.

See Best practice in http://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored

Rick James
  • 135,179
  • 13
  • 127
  • 222
  • thank you for answer, i just nedeed to include the sets to my script when i create the db and now it is fine. And when you apply the default character set and collate it is applied to all the tables by default. – Héctor3315 Aug 20 '17 at 04:37