Sign in to follow this  
Followers 0
wertzui

data URI charset is ignored

3 posts in this topic

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.

Share this post


Link to post
Share on other sites

This worked for me:data:text/csv;charset=windows-1252,%FC;%E4;%F6This also works:data:text/csv;charset=windows-1252;base64,/DvkO/Y=

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0