angular-file-saver
angular-file-saver copied to clipboard
Change the Format of Encoding/File
Hey, How can I change the Encoding Format of the File I create with this package?
data = new Blob([str], {
type: 'application/json;charset=ansi;'
});
// Export "Download"
this.FileSaver.saveAs(data, this.$scope.selectedLang[i].code + '.php');
Changing the charset to ansi instead of utf8 did nothing on the File, it is still UTF8. Even removing the whole option is not changing anything at all or Errors.
var data = new Blob([angular.toJson(res, true)]);//no option
// Export "Download"
this.FileSaver.saveAs(data, 'texte_' + this.$scope.selectedLang[i].pp_id + '.json');
I want to create 3 Files (.json->utf8/.php->ansi/.properties->ansi) Where can I tell Filesave in which Encoding Format it should be saved?
I have the same problem:
const blob = new Blob(['\ufeff', response.body], { type: 'text/csv;charset=ansi;' });
saveAs(blob, filename, true);
with '\ufeff' => UTF-8 without '\ufeff' => UTF-8 w/o BOM
but I need ANSI