From 647fbb3335866ee146c1ecef497c9f3a2e4dccae Mon Sep 17 00:00:00 2001 From: Christophe Date: Tue, 12 Nov 2024 16:53:22 +0000 Subject: [PATCH 1/2] Use utf8mb4. --- src/dba/AbstractModelFactory.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dba/AbstractModelFactory.class.php b/src/dba/AbstractModelFactory.class.php index c6c596e84..7ec5214a5 100755 --- a/src/dba/AbstractModelFactory.class.php +++ b/src/dba/AbstractModelFactory.class.php @@ -855,7 +855,7 @@ public function getDB($test = false) { } else { global $CONN; - $dsn = 'mysql:dbname=' . $CONN['db'] . ";host=" . $CONN['server'] . ";port=" . $CONN['port'] . ";charset=utf8"; + $dsn = 'mysql:dbname=' . $CONN['db'] . ";host=" . $CONN['server'] . ";port=" . $CONN['port'] . ";charset=utf8mb4"; $user = $CONN['user']; $password = $CONN['pass']; } From 8408fb06ba8bda007f2ccc56cf9a344ce9ba4a36 Mon Sep 17 00:00:00 2001 From: Christophe Date: Wed, 27 Nov 2024 15:22:37 +0000 Subject: [PATCH 2/2] Added comment, added changelog entry. --- doc/changelog.md | 7 +++++++ src/dba/AbstractModelFactory.class.php | 2 ++ 2 files changed, 9 insertions(+) diff --git a/doc/changelog.md b/doc/changelog.md index ae76dbe52..0aa39dda7 100644 --- a/doc/changelog.md +++ b/doc/changelog.md @@ -1,3 +1,10 @@ +# v0.14.3 -> v0.14.4 + +## Enhancements + +- Use utf8mb4 as default encoding in order to support the full unicode range + + # v0.14.2 -> v0.14.3 ## Tech Preview New API diff --git a/src/dba/AbstractModelFactory.class.php b/src/dba/AbstractModelFactory.class.php index 7ec5214a5..249ede9e8 100755 --- a/src/dba/AbstractModelFactory.class.php +++ b/src/dba/AbstractModelFactory.class.php @@ -855,6 +855,8 @@ public function getDB($test = false) { } else { global $CONN; + // 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'];