multer icon indicating copy to clipboard operation
multer copied to clipboard

accept utf8 filenames

Open almontasser opened this issue 2 years ago • 5 comments

almontasser avatar Nov 19 '22 13:11 almontasser

This PR should fix #1015 #1104

almontasser avatar Nov 19 '22 13:11 almontasser

maybe It would be nice to be able to specify what encoding to use instead. Changing the default encoding will be a breaking change. What about people that don't want/can't use utf8?

dumbasPL avatar Jan 31 '23 10:01 dumbasPL

Sorry for the late response on this.

It feels like this is a breaking change? In that case I don't see how we could get it into the 1.x release, but maybe we can do the same change in the 2.x branch? (#399)

LinusU avatar Feb 01 '23 04:02 LinusU

It feels like this is a breaking change?

yes, because currently, people are using the Buffer.from(filename, 'latin1').toString('utf8'); trick. If we parse an utf8 string as latin1 it will spit out garbage.

That's why I suggested only adding an option to change the encoding as a config option but leaving the default one as is to not break existing setups.

but maybe we can do the same change in the 2.x branch?

sounds good as well

dumbasPL avatar Feb 01 '23 08:02 dumbasPL

@LinusU I created a different PR that doesn't break backward compatibility - it extends the multer's API with a default defParamCharset: 'latin1' value Also, improved the translations https://github.com/expressjs/multer/pull/1210

Doc999tor avatar Jul 27 '23 21:07 Doc999tor