From 14a268ba7a7ec0127285f3cfdc253ce602da8170 Mon Sep 17 00:00:00 2001 From: Georgi Nikolov Date: Sat, 25 Jan 2025 17:14:13 +0200 Subject: Fixed an issue with the encoding of the html pages when donwloading them --- controllers/archive_page.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'controllers') diff --git a/controllers/archive_page.php b/controllers/archive_page.php index be73757..7372681 100644 --- a/controllers/archive_page.php +++ b/controllers/archive_page.php @@ -208,7 +208,8 @@ class DownloadPage { function createArchive($simular_pages) : void { // Creates the folder with the correct resources and the main html page in a index.html tag $dom = new DOMDocument(); - @$dom->loadHTML($this->page_contents); // This suppresses warnings for invalid HTML + $contentType = ''; // Ensures the encoding is UTF-8 + @$dom->loadHTML($contentType . $this->page_contents); // This suppresses warnings for invalid HTML $folder_path = $this->folder_location . '/' . $this->folder_name; if (!file_exists($folder_path)) { -- cgit v1.2.3