Verifica charsetul tabelului in care stochez acea informatie sa fie utf8. Ex: utf8_general_ci
Mai poti seta encodingul conexiunii catre dintre script si mysql cu SET NAMES UTF8;
Când am citit întrebarea m-am gândit direct la utf8_bin. Recunosc că habar n-aveam de utf8mb4.
Poți să explici, te rog, în câteva cuvinte care ar fi diferența între cele două?
Pe scurt, poate reprezenta un set mult mai mare de caractere, pentru că folosește maxim 4 bytes per caracter, față de 3 bytes ai utf8. Pe lung, din docs:
The character set named utf8 uses a maximum of three bytes per character and contains only BMP characters. As of MySQL 5.5.3, the utf8mb4 character set uses a maximum of four bytes per character supports supplemental characters:
For a BMP character, utf8 and utf8mb4 have identical storage characteristics: same code values, same encoding, same length.
For a supplementary character, utf8 cannot store the character at all, while utf8mb4 requires four bytes to store it. Since utf8 cannot store the character at all, you do not have any supplementary characters in utf8 columns and you need not worry about converting characters or losing data when upgrading utf8 data from older versions of MySQL.