Closed
Description
Chrome and Firefox "entity encode" unicode file names. Safari does not.
Chrome:"JΛ̊KE_2023-02-25T16:44:24.129Z.avif"
Safari: "JΛ̊KE_2023-02-25T16:44:24.129Z.avif"
( I had to change & to "& amp ;" on the Chrome file name to show the problem)
My workaround is:
form.on("file",(_,file)=>file.originalFilename=parseHtmlEntities(file.originalFilename));
function parseHtmlEntities(str) {
return str
.replace(/&#([0-9]{1,5});/g, (m,d)=>String.fromCharCode( parseInt(d,10)))
}