Fix Unicode encoding issue in file operations #1

Closed
xcaliber wants to merge 0 commits from fix-unicode-encoding into main
Owner

This PR addresses the Unicode encoding issue in the create_file and update_file functions by adding proper Unicode handling when encoding content to base64.\n\nChanges include:\n1. Added _safe_encode_content helper method to handle Unicode characters properly\n2. Added _safe_decode_content helper method for decoding base64 content\n3. Updated create_file and update_file functions to use these helper methods\n4. Improved error handling for encoding/decoding failures\n\nThis should resolve the "surrogates not allowed" UnicodeEncodeError that was occurring when trying to create or update files with certain Unicode characters.

This PR addresses the Unicode encoding issue in the `create_file` and `update_file` functions by adding proper Unicode handling when encoding content to base64.\n\nChanges include:\n1. Added `_safe_encode_content` helper method to handle Unicode characters properly\n2. Added `_safe_decode_content` helper method for decoding base64 content\n3. Updated `create_file` and `update_file` functions to use these helper methods\n4. Improved error handling for encoding/decoding failures\n\nThis should resolve the \"surrogates not allowed\" UnicodeEncodeError that was occurring when trying to create or update files with certain Unicode characters.
xcaliber closed this pull request 2026-01-15 00:29:25 +00:00

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: open-webui-automation/tools#1
No description provided.