From 838302468c11cf73377196962bd357bf2db84551 Mon Sep 17 00:00:00 2001 From: wang1212 Date: Tue, 1 Sep 2026 02:07:42 +0800 Subject: [PATCH] fix: set view blob charset=utf-8 to avoid non-ASCII mojibake viewAsMarkdown opens page content in a new tab via Blob([content], { type: "text/plain" }). Without an explicit charset, the browser falls back to ISO-8859-1 for text/plain, so UTF-8 byte streams are decoded as latin1 and non-ASCII text (e.g. CJK) renders as mojibake. Declare charset=utf-8 so the blob is decoded correctly. --- src/CopyPageButton.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CopyPageButton.js b/src/CopyPageButton.js index 4e744c7..8f56703 100644 --- a/src/CopyPageButton.js +++ b/src/CopyPageButton.js @@ -290,7 +290,7 @@ Please provide a clear summary and help me understand the key concepts covered i } try { - const blob = new Blob([contentToView], { type: "text/plain" }); + const blob = new Blob([contentToView], { type: "text/plain;charset=utf-8" }); const url = URL.createObjectURL(blob); window.open(url, "_blank"); } catch (err) {