mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 16:38:16 +01:00
Fix Non-ASCII characters being escaped if in wrong locale (#369)
This commit is contained in:
parent
d8fd5e9bb4
commit
4de98fd782
1 changed files with 5 additions and 2 deletions
|
@ -41,6 +41,9 @@ def safe_print(message=""):
|
|||
except UnicodeEncodeError:
|
||||
pass
|
||||
|
||||
try:
|
||||
print(message.encode('utf-8', 'backslashreplace'))
|
||||
except UnicodeEncodeError:
|
||||
try:
|
||||
print(message.encode('ascii', 'backslashreplace'))
|
||||
except UnicodeEncodeError:
|
||||
|
|
Loading…
Reference in a new issue