mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 15:12:06 +00:00 
			
		
		
		
	Fix Non-ASCII characters being escaped if in wrong locale (#369)
This commit is contained in:
		| @@ -41,6 +41,9 @@ def safe_print(message=""): | |||||||
|     except UnicodeEncodeError: |     except UnicodeEncodeError: | ||||||
|         pass |         pass | ||||||
|  |  | ||||||
|  |     try: | ||||||
|  |         print(message.encode('utf-8', 'backslashreplace')) | ||||||
|  |     except UnicodeEncodeError: | ||||||
|         try: |         try: | ||||||
|             print(message.encode('ascii', 'backslashreplace')) |             print(message.encode('ascii', 'backslashreplace')) | ||||||
|         except UnicodeEncodeError: |         except UnicodeEncodeError: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user