diff --git a/webview-ui/src/components/common/MermaidBlock.tsx b/webview-ui/src/components/common/MermaidBlock.tsx index c5fc8b30bb..7d483d9c4f 100644 --- a/webview-ui/src/components/common/MermaidBlock.tsx +++ b/webview-ui/src/components/common/MermaidBlock.tsx @@ -243,7 +243,8 @@ async function svgToPng(svgEl: SVGElement): Promise { const serializer = new XMLSerializer() const svgString = serializer.serializeToString(svgClone) - const svgDataUrl = "data:image/svg+xml;base64," + btoa(decodeURIComponent(encodeURIComponent(svgString))) + + const svgDataUrl = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svgString)}` return new Promise((resolve, reject) => { const img = new Image()