From 23e4b9002f9f5085e18dcd56ff198ead2ab2ad39 Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 13 May 2022 18:10:55 +0200 Subject: [PATCH] support ?doc=mojibake --- copyparty/httpcli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index fcbb2bc6..9900b42c 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -2443,7 +2443,7 @@ class HttpCli(object): docpath = os.path.join(abspath, doc) sz = bos.path.getsize(docpath) if sz < 1024 * self.args.txt_max: - with open(docpath, "rb") as f: + with open(fsenc(docpath), "rb") as f: doctxt = f.read().decode("utf-8", "replace") else: self.log("doc 404: [{}]".format(doc), c=6)