From 3ef7c16e8d46c6772737abb8d97228a7694eba62 Mon Sep 17 00:00:00 2001 From: Christopher Pickering Date: Thu, 7 Jul 2022 13:38:23 -0500 Subject: [PATCH] fix(git bash): fixes char encoding on windows git bash closes #275 --- src/djlint/output.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/djlint/output.py b/src/djlint/output.py index ea5c091..9059b13 100644 --- a/src/djlint/output.py +++ b/src/djlint/output.py @@ -9,6 +9,15 @@ from colorama import Fore, Style from .settings import Config +try: + # this is used for windows + gitbash to set encoding correctly. + import sys + + sys.stdout.reconfigure(encoding="utf-8") # type: ignore[attr-defined] +# pylint:disable=W0703 +except BaseException: + pass + def print_output( config: Config, file_errors: List[Dict[Any, Any]], file_count: int