Repository navigation
fix: return readable Cyrillic and emoji from tools that use json.dumps - #350
Merged
Merged
Conversation
get_me, get_chat-style helpers, search_public_chats, get_sticker_sets, folders, drafts and others called json.dumps without ensure_ascii=False, so non-ASCII names came out as \\u0410\\u043b... while list_contacts and other tools returned plain text. Pass ensure_ascii=False everywhere and add a test that scans the package for calls that forget it. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018Xun6C4mXUAKbVSmiEEh79
chigwell
approved these changes
Oct 21, 2026
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.
Summary
The
json.dumpscalls that build tool output used the defaultensure_ascii=True, so every non-ASCII character came back as\uXXXXescapes: chat titles, folder names, sticker set names and contact names in Cyrillic, Greek, CJK — or containing emoji — reached the model as unreadable blobs ("Тест"instead of"Тест"). With several such escapes in a row this also wastes a large share of the response token budget.This adds
ensure_ascii=Falseto all 18 suchjson.dumpssites acrosstools/chats.py,contacts.py,folders.py,media.py,custom_emoji.py,groups.py,messages.pyandprofile.py. Output stays valid JSON — only the encoding of non-ASCII characters changes.Testing
tests/test_json_unicode.pyasserts Cyrillic titles and emoji round-trip literally in the affected tools.🤖 Generated with Claude Code