eligrey / eligrey/FileSaver.js
Encoding gets messed up with v2
Open
- Dominant language
- JavaScript
- Stars
- 22k
- Forks
- 4.3k
- PR merge metrics
- No merged PRs in 30d
Description
With v1 this works great, but I'm pretty sure that v2 saves the files as ANSI and not utf-8.
I'm using asp net core, and the API returns this:
return new FileContentResult(Encoding.UTF8.GetBytes(sb.ToString()), "text/plain;charset=utf-8");
In angular I save the file like this:
saveTxt(result: any, filename: string) {
const blob = new Blob([result], { type: 'text/plain;charset=utf-8' });
saveAs(blob, `${filename}.txt`);
}
I reverted to v1 till I figure out how to fix this.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.