@@ -143,11 +143,10 @@ public function __construct(LoopInterface $loop = null, ConnectorInterface $conn
143
143
* $factory->createConnection('localhost?timeout=0.5');
144
144
* ```
145
145
*
146
- * By default, the connection uses the `utf8` charset encoding. Note that
147
- * MySQL's `utf8` encoding (also known as `utf8mb3`) predates what is now
148
- * known as UTF-8 and for historical reasons doesn't support emojis and
149
- * other characters. If you want full UTF-8 support, you can pass the
150
- * charset encoding like this:
146
+ * By default, the connection provides full UTF-8 support (using the
147
+ * `utf8mb4` charset encoding). This should usually not be changed for most
148
+ * applications nowadays, but for legacy reasons you can change this to use
149
+ * a different ASCII-compatible charset encoding like this:
151
150
*
152
151
* ```php
153
152
* $factory->createConnection('localhost?charset=utf8mb4');
@@ -183,7 +182,7 @@ public function createConnection(
183
182
isset ($ parts ['user ' ]) ? rawurldecode ($ parts ['user ' ]) : 'root ' ,
184
183
isset ($ parts ['pass ' ]) ? rawurldecode ($ parts ['pass ' ]) : '' ,
185
184
isset ($ parts ['path ' ]) ? rawurldecode (ltrim ($ parts ['path ' ], '/ ' )) : '' ,
186
- isset ($ args ['charset ' ]) ? $ args ['charset ' ] : 'utf8 '
185
+ isset ($ args ['charset ' ]) ? $ args ['charset ' ] : 'utf8mb4 '
187
186
);
188
187
} catch (\InvalidArgumentException $ e ) {
189
188
return \React \Promise \reject ($ e );
@@ -363,11 +362,10 @@ public function createConnection(
363
362
* $factory->createLazyConnection('localhost?idle=0.1');
364
363
* ```
365
364
*
366
- * By default, the connection uses the `utf8` charset encoding. Note that
367
- * MySQL's `utf8` encoding (also known as `utf8mb3`) predates what is now
368
- * known as UTF-8 and for historical reasons doesn't support emojis and
369
- * other characters. If you want full UTF-8 support, you can pass the
370
- * charset encoding like this:
365
+ * By default, the connection provides full UTF-8 support (using the
366
+ * `utf8mb4` charset encoding). This should usually not be changed for most
367
+ * applications nowadays, but for legacy reasons you can change this to use
368
+ * a different ASCII-compatible charset encoding like this:
371
369
*
372
370
* ```php
373
371
* $factory->createLazyConnection('localhost?charset=utf8mb4');
0 commit comments