data URI charset is ignored


Recommended Posts

When i have a link like this:click methe file will be downloaded using utf-8 and not using windows-1252 encoding.

If you have Excel, you can clearly see this, as Excel will open any csv file using ANSI (for me that is windows-1252) Encoding.

So you can see that the chars are not encoded right.

If you are not on a computer where ANSI is windows-1252, try it with your local ANSI codepage.

Link to comment
Share on other sites

Yes, it will generate a downloadable file.

But the encoding of the file is always utf-8.

I created a fiddle here: http://jsfiddle.net/3vqr1djt/

When I open the file using windows-1252 Encoding (open with Excel, as it will ignore that the file is utf-8), it will display: ü ä ö

When i open the file with Notepad, it detects that the file is utf-8 and will display using utf-8 encoding: ü;ä;ö

So the file download is working, but the charset is ignored and utf-8 is always used.

Link to comment
Share on other sites