Skip to content

[BUG] Chinese output garbled in Terminal Shell Integration - breaks LLM context understanding on Windows #10606

@LuBao111

Description

@LuBao111

Problem (one or two sentences)

When executing any Python script that produces Chinese output (not limited to simple print statements), the text appears as garbled text (mojibake) in the Roo Code "Executing" interface. While I demonstrated this with a simple print example, this affects all standard output containing Chinese. (It is currently unconfirmed if other programming languages face the same encoding issue on Windows, but it is persistent with Python).

Context (who is affected and when)

This affects Windows users relying on Roo Code's Terminal Shell Integration.
Crucially, this issue impacts not only human readability but also the LLM's ability to interpret the output. Since the model "reads" the output captured via the shell integration to verify execution results, the garbled text prevents the LLM from confirming that the script ran correctly, leading to potential hallucinations or unnecessary debugging loops.

Reproduction steps

  1. Create a Python script (e.g., 1.py) with the following content:
    print("Hello, World!")
    print("你好,世界!")
  2. Ask Roo Code to run this file: python 1.py
  3. Observe Failure: The English text is correct, but the Chinese text is garbled.
Image
  1. Verify Fix: Modify the script to force UTF-8 encoding:
    import sys
    sys.stdout.reconfigure(encoding='utf-8')
    print("你好,世界!")
  2. Run the script again via Roo Code.
  3. Observe Success: The Chinese text now displays correctly, confirming the root cause is stdout encoding.
Image

Expected result

Hello, World!你好,世界!

Actual result

Hello, World! ��ã����磡

Variations tried (optional)

No response

App Version

Version: 3.39.2

API Provider (optional)

DeepSeek

Model Used (optional)

N/A

Roo Code Task Links (optional)

No response

Relevant logs or errors (optional)

Hello, World!
��ã����磡

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue/PR - TriageNew issue. Needs quick review to confirm validity and assign labels.bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions