diff --git a/copyparty/util.py b/copyparty/util.py index 505c96cb..23f85777 100644 --- a/copyparty/util.py +++ b/copyparty/util.py @@ -658,6 +658,9 @@ def read_utf8(log: Optional["NamedLogger"], ap: Union[str, bytes], strict: bool) with open(ap, "rb") as f: buf = f.read() + if buf.startswith(b"\xef\xbb\xbf"): + buf = buf[3:] + try: return buf.decode("utf-8", "strict") except UnicodeDecodeError as ex: