Can not insert emojis in issues or comments #5944

Closed
opened 2025-11-02 06:40:58 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @gerricom on GitHub (Sep 4, 2020).

  • Gitea version (or commit ref): 1.12.4
  • Git version: 1.8.3.1
  • Operating system: CentOS 7
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log:
2020/09/04 10:25:46 ...m.io/xorm/core/tx.go:130:ExecContext() [I] [SQL] INSERT INTO `comment` (`type`,`poster_id`,`original_author`,`original_author_id`,`issue_id`,`label_id`,`old_milestone_id`,`milestone_id`,`assignee_id`,`removed_assignee`,`resolve_doer_id`,`old_title`,`new_title`,`old_ref`,`new_ref`,`dependent_issue_id`,`commit_id`,`line`,`tree_path`,`content`,`patch`,`created_unix`,`updated_unix`,`commit_sha`,`review_id`,`invalidated`,`ref_repo_id`,`ref_issue_id`,`ref_comment_id`,`ref_action`,`ref_is_pull`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [0 1  0 1809 0 0 0 0 false 0     0 0 0  😇  1599207946 1599207946  0 false 0 0 0 0 false] - 499.062µs
2020/09/04 10:25:46 ...o/xorm/session_tx.go:46:Rollback() [I] [SQL] ROLL BACK [] - 231.66µs
2020/09/04 10:25:46 ...outers/repo/issue.go:1603:NewComment() [E] CreateIssueComment: Error 1366: Incorrect string value: '\xF0\x9F\x98\x87' for column `gitea`.`comment`.`content` at row 1

Description

With the latest release of gitea we can't create comments or issues with emojis in it. Yes, the database is converted to utf8mb4 and I rechecked all the relevant tables.

We all are very sure, that this worked in previous releases. We missed 1.12.3 and went from 1.12.2 straight to 1.12.4, but I can't figure if this is a problem.

Has perhaps something changed with the encoding of the query to MySQL?

I am able to perform the insert query manually with my MySQL-Client. I am not getting any error then.

Originally created by @gerricom on GitHub (Sep 4, 2020). - Gitea version (or commit ref): 1.12.4 - Git version: 1.8.3.1 - Operating system: CentOS 7 - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant - Log: ``` 2020/09/04 10:25:46 ...m.io/xorm/core/tx.go:130:ExecContext() [I] [SQL] INSERT INTO `comment` (`type`,`poster_id`,`original_author`,`original_author_id`,`issue_id`,`label_id`,`old_milestone_id`,`milestone_id`,`assignee_id`,`removed_assignee`,`resolve_doer_id`,`old_title`,`new_title`,`old_ref`,`new_ref`,`dependent_issue_id`,`commit_id`,`line`,`tree_path`,`content`,`patch`,`created_unix`,`updated_unix`,`commit_sha`,`review_id`,`invalidated`,`ref_repo_id`,`ref_issue_id`,`ref_comment_id`,`ref_action`,`ref_is_pull`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [0 1 0 1809 0 0 0 0 false 0 0 0 0 😇 1599207946 1599207946 0 false 0 0 0 0 false] - 499.062µs 2020/09/04 10:25:46 ...o/xorm/session_tx.go:46:Rollback() [I] [SQL] ROLL BACK [] - 231.66µs 2020/09/04 10:25:46 ...outers/repo/issue.go:1603:NewComment() [E] CreateIssueComment: Error 1366: Incorrect string value: '\xF0\x9F\x98\x87' for column `gitea`.`comment`.`content` at row 1 ``` ## Description With the latest release of gitea we can't create comments or issues with emojis in it. Yes, the database is converted to utf8mb4 and I rechecked all the relevant tables. We all are very sure, that this worked in previous releases. We missed 1.12.3 and went from 1.12.2 straight to 1.12.4, but I can't figure if this is a problem. Has perhaps something changed with the encoding of the query to MySQL? I am able to perform the insert query manually with my MySQL-Client. I am not getting any error then.
Author
Owner

@lunny commented on GitHub (Sep 4, 2020):

Could you check you have changed your app.ini

[database]
charset=utf8mb4
@lunny commented on GitHub (Sep 4, 2020): Could you check you have changed your app.ini ```ini [database] charset=utf8mb4 ```
Author
Owner

@gerricom commented on GitHub (Sep 4, 2020):

Thanks. This wasn't defined in our app.ini. After adding this, we can now use emojis again. Thanks for that swift response!

@gerricom commented on GitHub (Sep 4, 2020): Thanks. This wasn't defined in our app.ini. After adding this, we can now use emojis again. Thanks for that swift response!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5944