-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Open
Labels
bugunicodeBugs and enhancements related to Unicode/UTF-8 support.Bugs and enhancements related to Unicode/UTF-8 support.
Description
$ ./build-coverage/micropython
MicroPython 9c7067d9ad on 2023-11-28; linux [GCC 12.2.0] version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> s = f"{160:c}"
>>> len(s)
0
>>> s
' '
>>> print(s)
�
The same for s = "%c" % 160
.
I think this is because the 'c'
formatter in objstr.c doesn't handle non-ASCII characters properly. It looks like this ends up being another way to get improper UTF-8 into a str() object, too.
Metadata
Metadata
Assignees
Labels
bugunicodeBugs and enhancements related to Unicode/UTF-8 support.Bugs and enhancements related to Unicode/UTF-8 support.