Skip to content

Commit 9df7893

Browse files
committed
🐛 Fix: encoded url fileName unreadable
1 parent ab3f03e commit 9df7893

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/utils/common.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,11 @@ export const getURLFile = async (url: string, ctx: IPicGo): Promise<IPathTransfo
9090
clearTimeout(timeoutId)
9191
if (isImage) {
9292
const urlPath = new URL(url).pathname
93+
// Decode the URL-encoded filename to handle non-ASCII characters like Chinese
94+
const decodedFileName = decodeURIComponent(path.basename(urlPath))
9395
resolve({
9496
buffer: res,
95-
fileName: path.basename(urlPath),
97+
fileName: decodedFileName,
9698
extname,
9799
success: true
98100
})

0 commit comments

Comments
 (0)