diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 124b19a6..aa860070 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -98,10 +98,10 @@ $ export PYTEST_HOST=localhost $ export PYTEST_USER=user $ export PYTEST_PASSWORD=myclirocks $ export PYTEST_PORT=3306 -$ export PYTEST_CHARSET=utf8 +$ export PYTEST_CHARSET=utf8mb4 ``` -The default values are `localhost`, `root`, no password, `3306`, and `utf8`. +The default values are `localhost`, `root`, no password, `3306`, and `utf8mb4`. You only need to set the values that differ from the defaults. diff --git a/changelog.md b/changelog.md index 02f53cc7..8a7eadb9 100644 --- a/changelog.md +++ b/changelog.md @@ -10,7 +10,7 @@ Features: * Allow customization of Pygments SQL syntax-highlighting styles. * Add a `\clip` special command to copy queries to the system clipboard. * Add a special command `\pipe_once` to pipe output to a subprocess. - +* Default to standards-compliant `utf8mb4` character set. Bug Fixes: ---------- diff --git a/mycli/main.py b/mycli/main.py index c66d048a..2fb73373 100755 --- a/mycli/main.py +++ b/mycli/main.py @@ -398,7 +398,7 @@ def connect(self, database='', user='', passwd='', host='', port='', ssl = ssl or {} passwd = passwd if isinstance(passwd, str) else cnf['password'] - charset = charset or cnf['default-character-set'] or 'utf8' + charset = charset or cnf['default-character-set'] or 'utf8mb4' # Favor whichever local_infile option is set. for local_infile_option in (local_infile, cnf['local-infile'], diff --git a/test/utils.py b/test/utils.py index 66b41940..87461c0d 100644 --- a/test/utils.py +++ b/test/utils.py @@ -13,7 +13,7 @@ USER = os.getenv('PYTEST_USER', 'root') HOST = os.getenv('PYTEST_HOST', 'localhost') PORT = int(os.getenv('PYTEST_PORT', 3306)) -CHARSET = os.getenv('PYTEST_CHARSET', 'utf8') +CHARSET = os.getenv('PYTEST_CHARSET', 'utf8mb4') SSH_USER = os.getenv('PYTEST_SSH_USER', None) SSH_HOST = os.getenv('PYTEST_SSH_HOST', None) SSH_PORT = os.getenv('PYTEST_SSH_PORT', 22)