Skip to content

Commit

Permalink
Merge pull request #284 from ticalc-travis/char-encoding
Browse files Browse the repository at this point in the history
Chrome: Fix corrupted non-ASCII characters on file save
  • Loading branch information
gfwilliams authored Sep 7, 2023
2 parents 6f27f7d + af96174 commit a03d83d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions js/core/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -533,10 +533,7 @@
}).
then(w => {
writable = w;
var data = fileToSave.contents;
var rawdata = new Uint8Array(data.length);
for (var i=0;i<data.length;i++) rawdata[i]=data.charCodeAt(i);
var fileBlob = new Blob([rawdata.buffer], {type: "text/plain"});
var fileBlob = new Blob([fileToSave.contents], {type: "text/plain"});
return writable.write(fileBlob);
}).
then(() => writable.close()).
Expand Down

0 comments on commit a03d83d

Please sign in to comment.