From b6b7f06b88e9c899244fa6219933dbe6cbab2c89 Mon Sep 17 00:00:00 2001 From: Diogo Resende Date: Wed, 4 May 2016 15:59:15 +0100 Subject: [PATCH] server: changes default encoding from UTF8_GENERAL_CI to UTF8MB4_UNICODE_CI http://stackoverflow.com/a/766996/977422 --- Readme.md | 4 ++-- lib/ConnectionConfig.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Readme.md b/Readme.md index 2f34a6d3d..7283e0258 100644 --- a/Readme.md +++ b/Readme.md @@ -194,8 +194,8 @@ When establishing a connection, you can set the following options: * `password`: The password of that MySQL user. * `database`: Name of the database to use for this connection (Optional). * `charset`: The charset for the connection. This is called "collation" in the SQL-level - of MySQL (like `utf8_general_ci`). If a SQL-level charset is specified (like `utf8mb4`) - then the default collation for that charset is used. (Default: `'UTF8_GENERAL_CI'`) + of MySQL (like `utf8mb4_unicode_ci`). If a SQL-level charset is specified (like `utf8mb4`) + then the default collation for that charset is used. (Default: `'UTF8MB4_UNICODE_CI'`) * `timezone`: The timezone used to store local dates. (Default: `'local'`) * `connectTimeout`: The milliseconds before a timeout occurs during the initial connection to the MySQL server. (Default: `10000`) diff --git a/lib/ConnectionConfig.js b/lib/ConnectionConfig.js index f15d5a0ab..07dd3f29e 100644 --- a/lib/ConnectionConfig.js +++ b/lib/ConnectionConfig.js @@ -53,7 +53,7 @@ function ConnectionConfig(options) { this.maxPacketSize = 0; this.charsetNumber = (options.charset) ? ConnectionConfig.getCharsetNumber(options.charset) - : options.charsetNumber||Charsets.UTF8_GENERAL_CI; + : options.charsetNumber||Charsets.UTF8MB4_UNICODE_CI; // Set the client flags var defaultFlags = ConnectionConfig.getDefaultFlags(options);