fix: encoding error after brand new installation (#654) #none

fix: encoding error after brand new installation
This commit is contained in:
Jinke 2025-02-14 06:32:39 -08:00 committed by GitHub
parent 647d0a4afe
commit 8b04f8475a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -50,7 +50,7 @@ class BaseApp:
with (dir_assets / "js" / "main.js").open() as fi:
self._js = fi.read()
self._js = self._js.replace("KH_APP_VERSION", self.app_version)
with (dir_assets / "js" / "pdf_viewer.js").open() as fi:
with (dir_assets / "js" / "pdf_viewer.js").open(encoding="utf-8") as fi:
self._pdf_view_js = fi.read()
# workaround for Windows path
pdf_js_dist_dir = str(PDFJS_PREBUILT_DIR).replace("\\", "\\\\")