Default to utf-8 on Windows

If it fails, we'll fall back to the system codepage
This commit is contained in:
twangboy 2018-03-07 16:45:45 -07:00
parent 4e7466a21c
commit 8d7e2d0058
No known key found for this signature in database
GPG key ID: 93FF3BDEB278C9EB

View file

@ -17,7 +17,10 @@ def get_encodings():
'''
return a list of string encodings to try
'''
encodings = [__salt_system_encoding__]
if salt.utils.is_windows():
encodings = ['utf-8', __salt_system_encoding__]
else:
encodings = [__salt_system_encoding__]
try:
sys_enc = sys.getdefaultencoding()