diff --git a/mkdocs_macros/plugin.py b/mkdocs_macros/plugin.py index 00aa362..d3f5b66 100644 --- a/mkdocs_macros/plugin.py +++ b/mkdocs_macros/plugin.py @@ -373,7 +373,7 @@ def _load_yaml(self): # Paths are be relative to the project root. filename = os.path.join(self.project_dir, filename) if os.path.isfile(filename): - with open(filename) as f: + with open(filename, encoding="utf-8") as f: # load the yaml file # NOTE: for the SafeLoader argument, see: https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation content = yaml.load(f, Loader=yaml.SafeLoader) diff --git a/setup.py b/setup.py index 0ceb7b5..dd5332f 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ def read_file(fname): "Read a local file" - return open(os.path.join(os.path.dirname(__file__), fname)).read() + return open(os.path.join(os.path.dirname(__file__), fname), encoding="utf-8").read() setup(