Skip to content

Chinese Character Truncation in REPL Output #51

@udreams

Description

@udreams

Describe the bug
In the MicroPython REPL, when printing Chinese text that exceeds the terminal line width, some characters are truncated. This issue does not occur with English text.

To Reproduce
Execute the following code in main.py
print('你好,世界!' * 30)

Expected behavior
The full Chinese string should be printed without truncation:
你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!你好,世界!
But, in actual, some Chinese characters are missing when the text wraps to a new line.

Screenshots or a Video

Image

Desktop (please provide the following information):

  • OS: Windows
  • IDE PyCharm Community
  • IDE Version 2025.1.3

MicroPython Board information (please complete the following information):

  • Board: ESP32
  • Version: 1.25.0

MicroPython Tools plugin

  • Version: 0.5.10
  • Used connection type Serial

Additional context
The issue may be caused by Chinese characters being treated as single-width characters.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions