From 8825ab4d9d70abccaf6868a5661ef84481a84063 Mon Sep 17 00:00:00 2001 From: Stable Diffusion Daemon Date: Tue, 8 Aug 2023 03:22:27 +0900 Subject: [PATCH] Add a statement to re-encode the filename --- scripts/ch_lib/downloader.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/ch_lib/downloader.py b/scripts/ch_lib/downloader.py index 2b14ebc..a183ab6 100644 --- a/scripts/ch_lib/downloader.py +++ b/scripts/ch_lib/downloader.py @@ -46,6 +46,7 @@ def dl(url, folder, filename, filepath): # content of a CD: "attachment;filename=FileName.txt" # in case "" is in CD filename's start and end, need to strip them out filename = cd.split("=")[1].strip('"') + filename = filename.encode('iso8859-1').decode('utf-8') if not filename: util.printD("Fail to get file name from Content-Disposition: " + cd) return