Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ThanaphatKalaya opened this issue Dec 6, 2021 · 1 comment
Open

Comments

@ThanaphatKalaya
Copy link

ThanaphatKalaya commented Dec 6, 2021

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
@yookoala yookoala added the bug label Dec 7, 2021
@SKuipers SKuipers added this to the UTF8MB4 Support milestone Jan 10, 2022
@SKuipers SKuipers added enhancement and removed bug labels Jan 10, 2022
@SKuipers
Copy link
Member

Hi @ThanaphatKalaya Thank you for looking into this and sharing your solution. Gibbon is not currently utf8mb4 compatible. I've added this to a utf8mb4 milestone, which we will work towards in the next version, v24.0.00. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants