Skip to content

Commit 8aedb6f

Browse files
committed
config: change default db charset to utf8mb4
1 parent e357c71 commit 8aedb6f

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

‎app/Config/Database.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class Database extends Config
3434
'DBPrefix' => '',
3535
'pConnect' => false,
3636
'DBDebug' => true,
37-
'charset' => 'utf8',
38-
'DBCollat' => 'utf8_general_ci',
37+
'charset' => 'utf8mb4',
38+
'DBCollat' => 'utf8mb4_general_ci',
3939
'swapPre' => '',
4040
'encrypt' => false,
4141
'compress' => false,
@@ -59,8 +59,8 @@ class Database extends Config
5959
'DBPrefix' => 'db_', // Needed to ensure we're working correctly with prefixes live. DO NOT REMOVE FOR CI DEVS
6060
'pConnect' => false,
6161
'DBDebug' => true,
62-
'charset' => 'utf8',
63-
'DBCollat' => 'utf8_general_ci',
62+
'charset' => 'utf8mb4',
63+
'DBCollat' => 'utf8mb4_general_ci',
6464
'swapPre' => '',
6565
'encrypt' => false,
6666
'compress' => false,

‎system/Database/BaseConnection.php‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,16 +136,20 @@ abstract class BaseConnection implements ConnectionInterface
136136
/**
137137
* Character set
138138
*
139+
* This value must be updated by Config\Database if the driver use it.
140+
*
139141
* @var string
140142
*/
141-
protected $charset = 'utf8';
143+
protected $charset = 'utf8mb4';
142144

143145
/**
144146
* Collation
145147
*
148+
* This value must be updated by Config\Database if the driver use it.
149+
*
146150
* @var string
147151
*/
148-
protected $DBCollat = 'utf8_general_ci';
152+
protected $DBCollat = 'utf8mb4_general_ci';
149153

150154
/**
151155
* Swap Prefix

0 commit comments

Comments
 (0)