1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Angular 5 file-saver saveAs CSV file encoding to ANSI

Discussão em 'Angular' iniciado por Stéphane GRILLON, Junho 30, 2025.

  1. I use Angular 5 + "file-saver": "^1.3.3" + "@types/file-saver": "^1.3.0"

    import { saveAs } from 'file-saver';
    const filename = parts[1].split('=')[1];
    const blob = new Blob(['\ufeff', response.body], { type: 'text/csv' });
    saveAs(blob, filename);


    create UTF-8 file

    import { saveAs } from 'file-saver';
    const filename = parts[1].split('=')[1];
    const blob = new Blob([response.body], { type: 'text/csv' });
    saveAs(blob, filename);


    create UTF-8 w/o BOM file

    But I need create ANSI file (for Excel and an other client)

    I try { type: 'text/csv;charset=ansi;' } but do not work.

    Continue reading...

Compartilhe esta Página