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

”DEFAULT COLLATE" of the Mysql database is fixed to "utf8".Utf8 string that uses 4 characters can not be used. #21

Closed
Yuutakasan opened this issue Mar 9, 2018 · 2 comments
Assignees
Labels
help wanted Feel free to contribute!

Comments

@Yuutakasan
Copy link

change the default character to utf8mb4.

query := fmt.Sprintf("CREATE DATABASE %s DEFAULT COLLATE utf8_general_ci", deets.Database)

query := fmt.Sprintf("CREATE DATABASE %s DEFAULT COLLATE utf8mb4_general_ci", deets.Database)

https://github.com/markbates/pop/blob/f244edc2b8f1335857465ccc9ede287aad6cd753/mysql.go

For reference, when Mysql 8 is released, I would like to use utf8mb4_ja_0900_as_cs.

Reference
http://mysqlserverteam.com/new-collations-in-mysql-8-0-0/
http://mysqlserverteam.com/sushi-beer-an-introduction-of-utf8-support-in-mysql-8-0/
http://mysqlserverteam.com/mysql-8-0-collations-the-devil-is-in-the-details/
http://mysqlserverteam.com/mysql-8-0-1-accent-and-case-sensitive-collations-for-utf8mb4/

@markbates
Copy link
Member

PRs are welcome. If you do open a PR for this, please make sure that it doesn't break support for MySQL 5.7.

@stanislas-m stanislas-m added enhancement help wanted Feel free to contribute! labels Apr 16, 2018
@stanislas-m stanislas-m self-assigned this Jun 20, 2018
stanislas-m added a commit that referenced this issue Jun 21, 2018
* Keep the default encoding to "utf8_general_ci" to not break current setups.
* Generate the templates with the "utf8mb4_general_ci" encoding, for new apps.
* New "encoding" param to set the encoding for DB creation & connection.
@stanislas-m
Copy link
Member

@Yuutakasan I made a PR to fix this issue. If you want to test the fix: #135.

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

No branches or pull requests

3 participants