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

Use utf8mb4 as default encoding #1127

Merged
merged 4 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# v0.14.3 -> v0.14.4


## Enhancements

- Use utf8mb4 as default encoding in order to support the full unicode range

## Bugfixes

- Fixed a bug where creating a new preprocessor would copy the configured limit command over the configured skip command
Expand Down
4 changes: 3 additions & 1 deletion src/dba/AbstractModelFactory.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,9 @@ public function getDB($test = false) {
}
else {
global $CONN;
$dsn = 'mysql:dbname=' . $CONN['db'] . ";host=" . $CONN['server'] . ";port=" . $CONN['port'] . ";charset=utf8";
// The utf8mb4 is here to force php to connect with that encoding, so you can save emoji's or other non ascii chars (specifically, unicode characters outside of the BMP) into the database.
// If you are running into issues with this line, we could make this configurable.
$dsn = 'mysql:dbname=' . $CONN['db'] . ";host=" . $CONN['server'] . ";port=" . $CONN['port'] . ";charset=utf8mb4";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment with the following comment:

# The utf8mb4 is here to force php to connect with utf8, so you can save emoji's or other non ascii chars into the database. If you are running into issues with this line, we could make this configurable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add an item to the changelog.md, you might need to create a header here for the new version.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

$user = $CONN['user'];
$password = $CONN['pass'];
}
Expand Down