0

I have a java script code which writes the file in UTF-8 encoding and because of that some characters gets changed when this file opens in Wordpad(Older vesion)
like ééééèèèààà(in UTF-8) changed to ééééèèèààà(in ANSI / older version of wordpad).

var filename = document.getElementById('my_label').innerHTML;
    filename = filename.replace(/.pdf,".txt");
    filename = filename.trim();
    var blob = new Blob([textout], {type: "text/plain;charset=utf-8"});
    saveAs(blob, filename);      

The characters should be same everywhere

Spr k
  • 36
  • 6

1 Answers1

0

Adding "\ufeff" at the beginning fixed the issue.

var blob = new Blob(["\ufeff",textout]

Same solution for this problem also. Found solution from this link

Spr k
  • 36
  • 6