Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use UTF-8 as default encoding #306

Merged
merged 1 commit into from Mar 27, 2021
Merged

Commits on Mar 10, 2021

  1. Use UTF-8 as default encoding

    The default value for the `encoding` paramter of `load_dotenv` and
    `dotenv_values` is now `"utf-8"` instead of `None` (which selected the
    encoding based on the user's locale).  It is passed directly to
    `io.open`.
    
    The rationale for this change is that the encoding of a project file
    like `.env` should not depend on the user's locale by default.  UTF-8
    makes sense as the default encoding since it is also used for Python
    source files.  The main drawback is that it departs from `open`'s
    default value of `None` for the `encoding` parameter.
    
    The default value of `None` was a source of confusion for some users.
    The Flask and Docker Compose projects already use `encoding="utf-8"` to
    enforce the use of UTF-8 and avoid that sort of confusion.
    
    This is a breaking change but only for users with a non-UTF-8 locale and
    non-UTF-8 characters in their .env files.
    bbc2 committed Mar 10, 2021
    Copy the full SHA
    24dea3c View commit details
    Browse the repository at this point in the history