Skip to content

Commit 32d4d18

Browse files
authored
Merge pull request #4 from ifTNT/fix-unicode
[fix] Add unicode support
2 parents cfc0b93 + c56716a commit 32d4d18

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

extension/background.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ function downloadTranscript() {
4747
// Create a download
4848
// Use Chrome Download API
4949
chrome.downloads.download({
50-
url: 'data:text/plain;base64,' + btoa(textContent),
50+
url: 'data:text/plain;base64,' + encodeUnicodeString(textContent),
5151
filename: fileName,
5252
conflictAction: 'uniquify' // Automatically rename the file if it already exists
5353
}).then(() => {
5454
console.log("Transcript downloaded to TranscripTonic directory")
5555
}).catch((error) => {
5656
console.log(error)
5757
chrome.downloads.download({
58-
url: 'data:text/plain;base64,' + btoa(textContent),
58+
url: 'data:text/plain;base64,' + encodeUnicodeString(textContent),
5959
filename: "TranscripTonic/Transcript.txt",
6060
conflictAction: 'uniquify' // Automatically rename the file if it already exists
6161
})
@@ -65,4 +65,11 @@ function downloadTranscript() {
6565
else
6666
console.log("No transcript found")
6767
})
68-
}
68+
}
69+
70+
// Thanks to @ifTNT(https://github.com/vivek-nexus/transcriptonic/pull/4)
71+
function encodeUnicodeString(text) {
72+
const utf8Bytes = new TextEncoder().encode(text)
73+
const binaryString = String.fromCodePoint(...utf8Bytes);
74+
return btoa(binaryString);
75+
}

extension/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "TranscripTonic",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"manifest_version": 3,
55
"description": "Simple Google Meet transcripts. Private and open source.",
66
"action": {

0 commit comments

Comments
 (0)