You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1.create a new file with filename a filename with Chinese-你好世界;
2.select in file input;
3.submit form;
4. the response filename is a filename with Chinese-你好世界
Current vs. Expected behavior
Expect get same file name.
and I found the root cause is here
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/sleepy-lamport-go8s7s
To Reproduce
1.create a new file with filename
a filename with Chinese-你好世界
;2.select in file input;
3.submit form;
4. the response filename is
a filename with Chinese-你好世界
Current vs. Expected behavior
Expect get same file name.
and I found the root cause is here
next.js/packages/next/src/server/app-render/action-handler.ts
Line 717 in c8c15e0
The busboy default
defParamCharset
islatin1
, if I submit chinese or other language with character not in latin1, the filename will garbled.https://github.com/mscdex/busboy?tab=readme-ov-file#exports
But if I create an API with Route, I can use
req.formdata()
then the filename is correct.Also, I tried
this config, then I can get correct filename with busboy, is that possible to set
utf-8
to keep same behavior likeBody.formdata()
?Provide environment information
Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:00 PDT 2024; root:xnu-10063.141.2~1/RELEASE_X86_64 Available memory (MB): 32768 Available CPU cores: 12 Binaries: Node: 20.17.0 npm: 10.8.2 Yarn: N/A pnpm: N/A Relevant Packages: next: 14.2.13 // Latest available version is detected (14.2.13). eslint-config-next: 14.2.13 react: 18.3.1 react-dom: 18.3.1 typescript: 5.5.4 Next.js Config: output: standalone
Which area(s) are affected? (Select all that apply)
Not sure, Runtime
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local), Vercel (Deployed), Other (Deployed)
Additional context
This issue exist in v14 and v15 canary.
The text was updated successfully, but these errors were encountered: