Skip to content

fix: return readable Cyrillic and emoji from tools that use json.dumps - #350

Merged
chigwell merged 1 commit into
chigwell:mainfrom
axisrow:fix/json-ensure-ascii
Oct 21, 2026
Merged

chigwell merged 1 commit into
chigwell:mainfrom
axisrow:fix/json-ensure-ascii

Conversation

@axisrow

@axisrow axisrow commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Summary

The json.dumps calls that build tool output used the default ensure_ascii=True, so every non-ASCII character came back as \uXXXX escapes: 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=False to all 18 such json.dumps sites across tools/chats.py, contacts.py, folders.py, media.py, custom_emoji.py, groups.py, messages.py and profile.py. Output stays valid JSON — only the encoding of non-ASCII characters changes.

Testing

  • tests/test_json_unicode.py asserts Cyrillic titles and emoji round-trip literally in the affected tools.
  • Full suite: 1409 passed.

🤖 Generated with Claude Code

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
chigwell merged commit e55d9c7 into chigwell:main Oct 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants