Setup framework to work with emojis
Created By DaVaR DaVaR @ 2020-12-08 20:52:50
Description Update helper.Database.php to use charset=utf8mb4
Code
$instance = new Database("$type:host=$host;dbname=$name;charset=utf8mb4", $user, $pass);
Both the databases and tables should have character set utf8mb4 and collation utf8mb4_unicode_ci. When creating a new database you should use:
Code
CREATE DATABASE mydb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
If you have an existing database and you want to add support:
Code
ALTER DATABASE database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
You also need to set the correct character set and collation for your tables:
Code
CREATE TABLE IF NOT EXISTS table_name (
    ...
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci;
or change it if you've got existing tables with a lot of data:
Code
ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Package
UserCandy Framework
Type
Enhancement

New feature or request.


Priority

Version
Any
Server
All
Folder
Database
0 Comments