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

MySQL UTF8 not working after DB restore #59

Closed
casper opened this issue Jul 2, 2019 · 3 comments
Closed

MySQL UTF8 not working after DB restore #59

casper opened this issue Jul 2, 2019 · 3 comments

Comments

@casper
Copy link

casper commented Jul 2, 2019

I restored my Instiki from a MySQL dump file, and all UTF8 characters now show up as if they had been interpreted as latin1 (I think). Example:

tärkeää uusintakäsittelyn välillä

Should be:
tärkeää uusintakäsittelyn välillä

If I look at the DB in the MySQL client everything looks correct. I also browse the DB with HeidiSQL and there as well all looks fine.

But when interpreted by Instiki it all comes out as garbled encoding on the webpage.
Any idea where the problem could be?

Running 0.30.1 on Ubuntu 18.04 with MySQL 5.7.23.
Using the mysql2 gem with "encoding: utf8" in database.yml.

@casper
Copy link
Author

casper commented Jul 2, 2019

Update:
Editing the corrupted page in the wiki and then resaving it fixes the corruption.
This seems to have solved the issue.

@casper casper closed this as completed Jul 2, 2019
@distler
Copy link
Collaborator

distler commented Jul 3, 2019

You definitely want to use encoding: utf8mb4, rather than encoding: utf8 (make sure the MySQL tables are also utf8mb4-encoded). Choosing encoding: utf8 will lead to data loss if your content contains any utf-8 characters outside the Basic Multilingual Plane.

See here and here.

@casper
Copy link
Author

casper commented Jul 3, 2019

Ok. Those are great references. Will have to convert my DB it seems. Thank you.

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

No branches or pull requests

2 participants