fix: file manager incorrectly decoding/encoding when editing files (made base64/utf8 dependent)

This commit is contained in:
LukeGus
2026-01-02 00:32:22 -06:00
parent bdf9ea282e
commit 177e783f92
4 changed files with 85 additions and 13 deletions

View File

@@ -333,13 +333,7 @@ export function FileViewer({
const ext = fileName.split(".").pop()?.toLowerCase() || "";
if (ext === "svg") {
try {
const base64 = btoa(unescape(encodeURIComponent(content)));
return `data:image/svg+xml;base64,${base64}`;
} catch (e) {
console.error("Failed to encode SVG:", e);
return "";
}
return `data:image/svg+xml;base64,${content}`;
}
return `data:image/*;base64,${content}`;