Skip to content

Emit literal Unicode in CLI and MCP JSON - #340

Open
novadev94 wants to merge 2 commits into
MinishLab:mainfrom
novadev94:feat/unicode-json-output
Open

novadev94 wants to merge 2 commits into
MinishLab:mainfrom
novadev94:feat/unicode-json-output

Conversation

@novadev94

Copy link
Copy Markdown

Closes #334

CLI JSON emits literal Unicode on UTF stdout and keeps ASCII escapes for other or unspecified encodings. MCP emits literal Unicode because its transports use UTF‑8.

This makes raw snippets easier to read and can save context tokens for agents that consume them directly. Tests cover Unicode output in both interfaces.

Use the declared stdout codec to preserve literal Unicode on UTF streams. Keep ASCII escapes when stdout uses a legacy encoding or does not declare one.

Exercise the café example through real text streams, including a Windows UTF-8 alias and a legacy code page.

Refs MinishLab#334
Use ensure_ascii=False for search and find_related JSON responses. MCP transports encode tool responses as UTF-8, so the terminal encoding does not constrain their text.

Use the cafe example to verify both tools expose literal café in the raw response. Checking decoded JSON alone would also pass with escaped output.

Refs MinishLab#334

This branch has not been deployed

No deployments
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.

Emit literal Unicode in CLI JSON on UTF streams

1 participant