← index #15979Issue #17762
Off-topic · high · value 1.634
QUERY · ISSUE

SPI Connection to SD Card Fails to Recognize Chinese Directories

openby ideasworkcnopened 2024-10-08updated 2026-01-20
bugunicode

Port, board and/or hardware

esp32

MicroPython version

When using SPI to connect an SD card in a MicroPython environment, directories with Chinese characters in their names are not recognized correctly. This results in errors or the directories being displayed as garbled text.

Reproduction

1.Connect an SD card to a MicroPython device using SPI.
2.list a directory on the SD card with a name containing Chinese characters.
3.list the Chinese directory contents using os.listdir().

Expected behaviour

The directory with Chinese characters should be listed correctly without errors.

Observed behaviour

The directory name appears as garbled text, and accessing it may result in errors.

Additional Information

No, I've provided everything above.

Code of Conduct

Yes, I agree

CANDIDATE · ISSUE

Warning "MicroPython ignores non-ascii characters of the input" when entering Chinese characters

closedby xiangxin1025opened 2025-07-25updated 2025-07-28
bug

Port, board and/or hardware

ESP32, ESP32S3

MicroPython version

**MicroPython Version: MicroPython v1.25.xx

Reproduction

Reproduction Steps:
Run the following test code in REPL:

# Receive and print Chinese input
chinese_input = input("请输入中文:")
print("你输入的是:", chinese_input)

# Simple processing of Chinese input
name = input("请输入你的名字:")
print(f"欢迎你,{name}!")

Expected behaviour

Expected Behavior:
Chinese characters should be input without warnings, regardless of using input() or sys.stdin.readline().

Observed behaviour

Observed Behavior:
When entering Chinese characters (non-ASCII), the warning WARNING: MicroPython ignores non-ascii characters of the input is displayed in REPL.

  • input() fails to properly receive Chinese characters.
  • sys.stdin.readline() can correctly获取 (obtain) Chinese character encoding but still triggers the same warning.

<img width="850" height="817" alt="Image" src="https://github.com/user-attachments/assets/e2cfa918-8cfd-4d8b-bee5-f1912235a358" />
<img width="891" height="852" alt="Image" src="https://github.com/user-attachments/assets/ec18a82e-6db8-413c-8768-97c37a0c5bdd" />

Additional Information

Additional Information:
Searched the source code (including shared/readline/readline.c, input handling modules, and warning-related files) for the exact warning string "ignores non-ascii characters" but found no matches.

Seeking guidance on how to eliminate this warning, even when the warning text is not explicitly hardcoded in the source.

Code of Conduct

Yes, I agree

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied