i have a textarea witch user can insert ascii characters(icon mostly) in it, when i try to insert it into my table :
with utf8_general_ci
or utf8_unicode_ci
every thing after the first ascii icon is removed and i am left with whatever text that was before the icon
with utf8mb4_general_ci
andutf8mb4_unicode_ci
all the ascii icons are converted to ?
so whats the best column type to save text with ascii icons in it ? do i need to escape them before inserting ? how ?
here is a sample of the text:
OK, found the answer my self, i had to set the connections character sets to utf8mb4
too, with the utf8mb4_unicode_ci
column.
'db' => [
'driver' => 'Pdo_Mysql',
'database' => 'telegram',
'hostname' => 'localhost',
'driver_options' => [
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'utf8mb4\'',
],
'username' => 'root',
'password' => '',
],
And of course the client and server too
[client]
default-character-set = utf8mb4
[mysql]
default-character-set = utf8mb4
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci