Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the Format of Encoding/File #33

Open
atodicebear opened this issue Sep 15, 2016 · 1 comment
Open

Change the Format of Encoding/File #33

atodicebear opened this issue Sep 15, 2016 · 1 comment

Comments

@atodicebear
Copy link

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?

@sgrillon14
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants