Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/app/components/artifact-tab/artifact-tab.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ export class ArtifactTabComponent implements OnChanges {
if (commaIndex === -1) return '';
const base64 = dataUrl.substring(commaIndex + 1);
try {
return atob(base64);
// Use decodeURIComponent(escape(...)) to correctly reconstruct Unicode
// strings from UTF-8 byte sequences produced by renderArtifact()'s
// btoa(unescape(encodeURIComponent(text))) encoding.
// Plain atob() returns a Latin-1 string, causing garbled non-ASCII text.
return decodeURIComponent(escape(atob(base64)));
} catch (e) {
return 'Failed to decode text content';
}
Expand Down
Loading