Skip to content

Some Emojis cannot be used in most text fields or text editors. #1583

@ThanaphatKalaya

Description

@ThanaphatKalaya

When attempting to add a description using emojis in a planner entry, the data was not saved after the initial emoji position. (Emojis with 4 digits hex work, but those with 5 digits do not.)

After some research, I discovered that it must deal with SQL connections and data collations.

So I try to alter all tables in my local database to use the utf8mb4_0900_ai_ci collation and configure my local server to connect as utf8mb4. That has resolved the difficulties.

MySqlConnector.php - line 49

$connection = new PDO($dsn, $config['databaseUsername'], $config['databasePassword'],
    array(
        PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8mb4"
    )
);

and query this

ALTER TABLE `gibbonPlannerEntry` COLLATE='utf8mb4_0900_ai_ci',CONVERT TO CHARSET utf8mb4;

To Reproduce

  1. Navigate to the 'Add Lesson Plan' page.
  2. Complete all required fields.
  3. Insert emojis into the description. (Noted that it works if you use advanced HTML code, but simply copy emojis and paste them do not)
  4. Save.
  5. Notice that the field was not completely saved.

Expected Behavior

  • The field was completely saved with emojis.

System

  • Gibbon v22.0.01
  • MySQL v8.0.26
  • PHP v7.3.31

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions