Skip to content

Commit da56a4d

Browse files
committed
bricks/_common/mpconfigport: enable unicode support
Enable MICROPY_PY_BUILTINS_STR_UNICODE on hubs with PYBRICKS_OPT_EXTRA_MOD. Without this, there is not any difference between str and bytes, which can make it hard to work with multi-byte characters.
1 parent 4d457a1 commit da56a4d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
## [Unreleased]
66

77
### Changed
8-
8+
- Enabled UTF-8 support for `str` objects.
99
- The method `DriveBase.angle()` now returns a float ([support#1844]). This
1010
makes it properly equivalent to `hub.imu.heading`.
1111

bricks/_common/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
#define MICROPY_PY_BUILTINS_SLICE (PYBRICKS_OPT_EXTRA_MOD)
8181
#define MICROPY_PY_BUILTINS_PROPERTY (0)
8282
#define MICROPY_PY_BUILTINS_MIN_MAX (1)
83+
#define MICROPY_PY_BUILTINS_STR_UNICODE (PYBRICKS_OPT_EXTRA_MOD)
8384
#define MICROPY_PY___FILE__ (0)
8485
#define MICROPY_PY_MICROPYTHON_MEM_INFO (1)
8586
#define MICROPY_PY_GC (PYBRICKS_OPT_EXTRA_MOD)

0 commit comments

Comments
 (0)