Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
salt.utils.hashutils: Only decode to utf-8 on Windows #48041
referenced this pull request
Jun 8, 2018
I suspect the raw string always needs to be US ASCII because a hash/checksum or base64 can only contain US ASCII characters as far as I have notice. Hence for windows where the language is not US ASCII and not UTF8 issues occurred. But it could also be the same for other platforms. Should this fix just be for windows or does it make more sense for it to be for all platforms?
I don't think this is needed on non-Windows platforms. The reason for doing this is because CP1252 is awful and will successfully decode bytestrings that it shouldn't, with corrupted results. UTF-8, latin-1, ascii, all don't have this problem. Forcing use of UTF-8 when decoding the bytestring on Windows keeps us from trying CP1252.