mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #21456] fix: use RFC 5987 encoding for non-ASCII knowledge export filenames #26088
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/21456
Author: @sangyongsin
Created: 2/16/2026
Status: 🔄 Open
Base:
dev← Head:fix/knowledge-export-non-ascii-filename📝 Commits (1)
6d554e5fix: use RFC 5987 encoding for non-ASCII knowledge export filenames📊 Changes
1 file changed (+6 additions, -1 deletions)
View changed files
📝
backend/open_webui/routers/knowledge.py(+6 -1)📄 Description
Pull Request Checklist
devbranch.urllib.parse.quoteis Python standard library.fix:Changelog Entry
Description
When exporting a knowledge base as ZIP, non-ASCII characters (Korean, Chinese, Japanese, etc.) in the filename are corrupted because the
Content-Dispositionheader puts them directly in thefilenameparameter, which only supports ASCII (latin-1 encoding).
This fix adds RFC 5987
filename*=UTF-8''with percent-encoded filename, which is supported by all modern browsers (IE11+, Chrome, Firefox, Edge, Safari).Added
urllib.parse.quoteimport for percent-encodingChanged
Deprecated
Removed
Fixed
filename*=UTF-8''encodingknowledge.zip) forfilenameparameter to prevent header encoding errorsSecurity
Breaking Changes
Additional Information
filenameparameter uses a generic ASCII fallback sincefilename*is supported by all modern browsers, and the added complexity of ASCII detection provides no practical benefit.Before (corrupted):
Content-Disposition: attachment; filename=회사규정.zip
→ Non-ASCII in
filenamecauses latin-1 encoding failure → corrupted filenameAfter (fixed):
Content-Disposition: attachment; filename="knowledge.zip"; filename*=UTF-8''%ED%9A%8C%EC%82%AC%EA%B7%9C%EC%A0%95.zip
→ Modern browsers use
filename*→ correct Korean filename displayedScreenshots or Videos
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and
I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.