fix(feishu): recover CJK filenames from JSON file_name field (fixes #81103)#93772
Merged
vincentkoc merged 2 commits intoJun 16, 2026
Merged
Conversation
Apply recoverUtf8FileNameFromLatin1Header to JSON-derived filenames in extractFeishuDownloadMetadata, matching the behavior already present for Content-Disposition headers in decodeDispositionFileName. Fixes openclaw#81103
Member
|
Maintainer review and repair complete. The fix now recovers the inbound Feishu/Lark original filename from the message payload before saving, while leaving SDK response metadata untouched. Verification:
Known proof gaps: none. |
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jun 17, 2026
…penclaw#81103) (openclaw#93772) * fix(feishu): recover CJK filenames from JSON file_name field Apply recoverUtf8FileNameFromLatin1Header to JSON-derived filenames in extractFeishuDownloadMetadata, matching the behavior already present for Content-Disposition headers in decodeDispositionFileName. Fixes openclaw#81103 * fix(feishu): recover inbound CJK filenames --------- Co-authored-by: Vincent Koc <[email protected]>
crh-code
pushed a commit
to crh-code/openclaw
that referenced
this pull request
Jun 18, 2026
…penclaw#81103) (openclaw#93772) * fix(feishu): recover CJK filenames from JSON file_name field Apply recoverUtf8FileNameFromLatin1Header to JSON-derived filenames in extractFeishuDownloadMetadata, matching the behavior already present for Content-Disposition headers in decodeDispositionFileName. Fixes openclaw#81103 * fix(feishu): recover inbound CJK filenames --------- Co-authored-by: Vincent Koc <[email protected]>
20 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
CJK filenames in inbound Feishu messages produce mojibake when the filename is delivered via the JSON
file_namefield. TherecoverUtf8FileNameFromLatin1Headerhelper is already called for Content-Disposition headers (decodeDispositionFileNameatextensions/feishu/src/media.ts:212) but not for the JSON fallback path inextractFeishuDownloadMetadata.This means
武汉15座山登山信息汇总.csvlands on disk asæ¦æ±15座山ç»å±±ä¿¡æ¯æ±æ»¥.csvwhen the Feishu API returns the filename in the JSON body.The existing test at line 902 ("keeps JSON-derived file_name metadata unchanged") actively asserted this broken behavior.
Fix
Apply
recoverUtf8FileNameFromLatin1Headerto the JSON-derived filename inextractFeishuDownloadMetadata, so CJK filenames are recovered regardless of which path carries the name. The helper is safe for non-Latin-1 values (returns input unchanged when recovery would produce U+FFFD or no East Asian script).Changed files:
extensions/feishu/src/media.ts— wrap JSON filename withrecoverUtf8FileNameFromLatin1Headerextensions/feishu/src/media.test.ts— fix existing test to assert CJK recovery, add Latin-1 passthrough coverageFixes #81103
Real behavior proof
Behavior addressed: Feishu inbound JSON
file_namewith CJK characters produces mojibake; Latin-1 filenames should pass through unchangedEnvironment tested: macOS 26.4.1, Node v25.8.2, OpenClaw main at e8022eb
Steps run after the patch:
recoverUtf8FileNameFromLatin1Headercorrectly recovers CJK from Latin-1 encodingpnpm build— build succeededrawFileNameis wrapped withrecoverUtf8FileNameFromLatin1Headerat media.ts:250-252Evidence after fix: