Skip to content

fix: keep non-ASCII text readable in task JSON files#133

Open
bluzername wants to merge 1 commit intoshareAI-lab:mainfrom
bluzername:fix/task-json-non-ascii
Open

fix: keep non-ASCII text readable in task JSON files#133
bluzername wants to merge 1 commit intoshareAI-lab:mainfrom
bluzername:fix/task-json-non-ascii

Conversation

@bluzername
Copy link
Copy Markdown

Problem

Task files in .tasks/task_*.json save Chinese and other non-ASCII characters as escaped Unicode sequences like \u6c47\u603b\u6210\u6700\u7ec8\u62a5\u544a instead of the actual readable text 汇总成最终报告.

This makes it very hard to debug task files when you open them in editor or terminal. You cannot read what the task is about without running it through a decoder first.

Fix

Added ensure_ascii=False parameter to all 4 json.dumps() calls in s07_task_system.py:

  1. _save() method (line 65) - writes task to disk
  2. create() return value (line 74) - returns new task as JSON string
  3. get() return value (line 77) - returns loaded task as JSON string
  4. update() return value (line 103) - returns updated task as JSON string

Before:

{"subject": "\u6c47\u603b\u6210\u6700\u7ec8\u62a5\u544a"}

After:

{"subject": "汇总成最终报告"}

Both formats are valid JSON and json.loads() handles them identical, so this change is fully backward compatible with existing task files. The only difference is readability.

Verification

  • Python syntax check passes
  • No behavioral change, just formatting of the output

Closes #106

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 26, 2026

@bluzername is attempting to deploy a commit to the crazyboym's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

Suggestion: keep non-ASCII task JSON readable in s07_task_system.py

1 participant