diff --git a/exchangelib/util.py b/exchangelib/util.py index 17f6220c..bc7c8fb3 100644 --- a/exchangelib/util.py +++ b/exchangelib/util.py @@ -516,7 +516,10 @@ def post_ratelimited(protocol, session, url, headers, data, allow_redirects=Fals except UnicodeDecodeError: import chardet encoding_info = chardet.detect(data) - data = data.decode('utf-8').encode(encoding_info['encoding']) + if encoding_info['encoding'] in ['ISO-8859-1', 'Windows-1252']: + data = data.decode("utf-8").encode("utf-8") + else: + data = data.decode('utf-8').encode(encoding_info['encoding']) try: r = session.post(url=url, headers=headers,