Decode upload filenames from latin1 to UTF-8
A self-maintained patch by Mor1arty fixes the upload pipeline's character-encoding assumption, so files with Chinese (and other non-ASCII) filenames no longer arrive with garbled names on the server side.
The upstream codebase relies on multer, which inherits Busboy's latin1 default when parsing the multipart filename header. That default is fine for ASCII, but breaks on multi-byte encodings - Chinese characters come through mangled before the file ever reaches any processing logic.
The fix lands in backend/src/lib/upload.ts: after multer resolves without error, the middleware now re-decodes req.file.originalname using Buffer.from(name, "latin1").toString("utf-8"). It's 10 lines added, one removed. The change only fires on the success branch and only when originalname is present.
Mor1arty opened and merged this within four minutes. The context - a CN-locale deployment uploading Chinese-language documents - makes the failure obvious and the fix unambiguous.
Spotted something wrong? Or know the PR text has fresher detail than the writeup above?