The code:
var blob;
blob = new Blob(file, {
encoding: "UTF-8",
type: "text/plain;charset=UTF-8"
});
saveAs(blob, "" + this._id + ".html");
It's strange if I imput an — in the textarea the download file shows a — (on Chrome) even though I specified the encoding and charset as UTF-8 (both textarea and html file viewed in the same browser). What could be the problem?
That means you didn't decode the downloaded file; UTF-8 will encode the em-dash as three bytes. That means to read the downloaded file, you need to tell your editor (or whatever tool you use to read the file) that the file content is encoded as UTF-8.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With