Wiki-Plugin: Error Message when save Page with emojis

I get error message: “Internal Error: SQL Error: SQLSTATE[HY000]: General error: 1366 Incorrect string value: ‘\xF0\x9F\x91\x8D \xF0…’ for column ‘content’ at row 1”.

For more details, Debug log and so on please see this Task!

Can someone reproduce that problem?

:blush: should be enough in the Wiki Page text body

I think i’ts reproduced:

Well, it appears that you could need another “little help”™, right? :face_with_raised_eyebrow:

I’m working on a fix, even if I don’t like to waste time with such unimportant things like emojis.

Well, for my affairs indeed very most emojis also are not important
But I often use :white_check_mark: :heavy_check_mark: :bulb: :bug: :spiral_calendar: :hammer_and_wrench: :hourglass_flowing_sand: because they are a very visible hint for status (or similar): done, done but bad, idea, bug, appointment, service required and pending …
And sometimes also :+1: :-1: :ok_hand: for test results
Works fine, but error messages are a little annoying and might worry other users on my KANBOARD

Thx for working on it.

And—some day I will remember what search string I used to miss the report on github …

1 Like

For MySQL, you can run the following three statements.

ALTER TABLE wikipage CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wikipage_editions CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE wikipage_has_files CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Or could patch your code or create a pull request with the entire snippet below.

File Schema/Mysql.php:

const VERSION = 9;

// Allow unicode emojis in wikipages
function version_9(PDO $pdo)
{
    $pdo->exec('ALTER TABLE wikipage CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci');
    $pdo->exec('ALTER TABLE wikipage_editions CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci');
    $pdo->exec('ALTER TABLE wikipage_has_files CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci');
}

For PostgreSQL, I don’t have any information at hand, as I don’t use nor have it. But I assume it would require a similar patch.

2 Likes