0

I am working in Alfresco and trying to download the file content as CSV file. The download works, but only problem is that when I download a content that has dash or em dash inside, when I open that CSV file I see %u2013 and %u2014 instead.

This is my code for that part, I use JavaScript, but I do know how to solve this issue:

                var blob = new Blob([CSV], {type: "text/csv;charset=utf-8;"});
                if (window.navigator.msSaveOrOpenBlob && window.Blob) {
                    navigator.msSaveOrOpenBlob(blob, fileName + ".csv");
                } else {
                    var uri = 'data:text/csv;charset=utf-8,' + escape(CSV);
                    var link = document.createElement("a");
                    link.href = uri;
                    link.style = "visibility:hidden";
                    link.download = fileName + ".csv";
                    document.body.appendChild(link);
                    if (navigator.userAgent.search("Chrome") > 0) {
                        setTimeout(function () {
                            link.click();
                        }, 2000);
                    } else {
                        link.click();
                    }
                }
                document.body.removeChild(link);

For example, value named abolix-fix after the download inside CSV file it is like this abolix%u2013fix.

Thanks in advance!

Mike1988B
  • 57
  • 5

0 Answers0