[GH-ISSUE #188] Error adding https://waitbutwhy.com/2019/08/story-intro.html as a bookmark #136

Closed
opened 2026-02-25 23:33:32 +03:00 by kerem · 8 comments
Owner

Originally created by @timshannon on GitHub (Oct 2, 2019).
Original GitHub issue: https://github.com/go-shiori/shiori/issues/188

Error adding https://waitbutwhy.com/2019/08/story-intro.html as a bookmark:

failed to save bookmark: Error 1366: Incorrect string value: '\xE2\x86\x92' for column `shiori`.`bookmark`.`author` at row 1 (500)
Originally created by @timshannon on GitHub (Oct 2, 2019). Original GitHub issue: https://github.com/go-shiori/shiori/issues/188 Error adding https://waitbutwhy.com/2019/08/story-intro.html as a bookmark: ``` failed to save bookmark: Error 1366: Incorrect string value: '\xE2\x86\x92' for column `shiori`.`bookmark`.`author` at row 1 (500) ```
kerem closed this issue 2026-02-25 23:33:32 +03:00
Author
Owner

@RadhiFadlillah commented on GitHub (Oct 3, 2019):

@timshannon hey, that's weird. May I know which database that you use ?

<!-- gh-comment-id:537926021 --> @RadhiFadlillah commented on GitHub (Oct 3, 2019): @timshannon hey, that's weird. May I know which database that you use ?
Author
Owner

@timshannon commented on GitHub (Oct 3, 2019):

mariadb 10.4.6.

I'll try to spin up a sqlite instance in docker and get back to you to see if I can replicate it there.

<!-- gh-comment-id:537939100 --> @timshannon commented on GitHub (Oct 3, 2019): mariadb 10.4.6. I'll try to spin up a sqlite instance in docker and get back to you to see if I can replicate it there.
Author
Owner

@timshannon commented on GitHub (Oct 3, 2019):

Yeah works fine with sqlite.

<!-- gh-comment-id:537948401 --> @timshannon commented on GitHub (Oct 3, 2019): Yeah works fine with sqlite.
Author
Owner

@RadhiFadlillah commented on GitHub (Oct 3, 2019):

Yep, in my machine it also works properly both in SQLite and MariaDB :

Screenshot_2019-10-03 Shiori - Bookmarks Manager

Could you check your character encoding ?

From the error message, it seems this issue is happened because your MariaDB doesn't support unicode icon . This might be happened because the character encoding in your MariaDB server is set to utf8 (which doesn't support emoticon) instead of utf8mb4.

<!-- gh-comment-id:537949837 --> @RadhiFadlillah commented on GitHub (Oct 3, 2019): Yep, in my machine it also works properly both in SQLite and MariaDB : ![Screenshot_2019-10-03 Shiori - Bookmarks Manager](https://user-images.githubusercontent.com/6129042/66131565-d6946400-e61d-11e9-92f1-d1b427f45ea5.png) Could you check your character encoding ? From the error message, it seems this issue is happened because your MariaDB doesn't support unicode icon `→`. This might be happened because the character encoding in your MariaDB server is set to `utf8` (which [doesn't](https://medium.com/@adamhooper/in-mysql-never-use-utf8-use-utf8mb4-11761243e434) support [emoticon](https://mathiasbynens.be/notes/mysql-utf8mb4)) instead of `utf8mb4`.
Author
Owner

@timshannon commented on GitHub (Oct 3, 2019):

So I'm just using the base mariadb image, you might want to consider forcing the character set and collation on database creation?

<!-- gh-comment-id:537952418 --> @timshannon commented on GitHub (Oct 3, 2019): So I'm just using the base mariadb image, you might want to consider forcing the character set and collation on database creation?
Author
Owner

@timshannon commented on GitHub (Oct 3, 2019):

For future reference for anyone else who runs into this, I got it working by switching the character set on the bookmarks table:

ALTER TABLE bookmark
 CONVERT TO CHARACTER SET utf8mb4;

Although you might want to do this on all tables.

<!-- gh-comment-id:537953371 --> @timshannon commented on GitHub (Oct 3, 2019): For future reference for anyone else who runs into this, I got it working by switching the character set on the bookmarks table: ```sql ALTER TABLE bookmark CONVERT TO CHARACTER SET utf8mb4; ``` Although you might want to do this on all tables.
Author
Owner

@RadhiFadlillah commented on GitHub (Oct 3, 2019):

So I'm just using the base mariadb image, you might want to consider forcing the character set and collation on database creation?

Done in a4dd1c8 .

Since this issue seem fixed by that, I will close this issue for now. Feels free to reopen it if needed.

<!-- gh-comment-id:537960425 --> @RadhiFadlillah commented on GitHub (Oct 3, 2019): > So I'm just using the base mariadb image, you might want to consider forcing the character set and collation on database creation? Done in [a4dd1c8 ](https://github.com/go-shiori/shiori/commit/a4dd1c86874d32e10cca566b7fd3caa5e7b41ae3). Since this issue seem fixed by that, I will close this issue for now. Feels free to reopen it if needed.
Author
Owner

@deanishe commented on GitHub (Dec 13, 2019):

Changing the charset in the database wasn't enough for me. I had to specify the charset on the MySQL connection, too. I've added that in PR #223

<!-- gh-comment-id:565343325 --> @deanishe commented on GitHub (Dec 13, 2019): Changing the charset in the database wasn't enough for me. I had to specify the charset on the MySQL connection, too. I've added that in PR #223
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shiori#136
No description provided.