Skip to content

Commit

Permalink
Use utf8mb4 as default encoding (#1127)
Browse files Browse the repository at this point in the history
* Use utf8mb4.

* Added comment, added changelog entry.

---------

Co-authored-by: jessevz <[email protected]>
  • Loading branch information
gochujang-c and jessevz authored Nov 28, 2024
1 parent 5e40910 commit 80c8c14
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
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";
$user = $CONN['user'];
$password = $CONN['pass'];
}
Expand Down

0 comments on commit 80c8c14

Please sign in to comment.