Skip to content

Commit

Permalink
bricks/_common/mpconfigport: Enable unicode.
Browse files Browse the repository at this point in the history
Enable MICROPY_PY_BUILTINS_STR_UNICODE on hubs with PYBRICKS_OPT_EXTRA_LEVEL2.

Without this, there is not any difference between str and bytes, which
can make it hard to work with multi-byte characters.
  • Loading branch information
dlech authored and laurensvalk committed Dec 5, 2024
1 parent 19b1ec1 commit 47bb9a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
state.

### Changed

- Enabled UTF-8 support for `str` objects.
- The method `DriveBase.angle()` now returns a float ([support#1844]). This
makes it properly equivalent to `hub.imu.heading`.
- Re-implemented tilt using the gyro data by default. Pure accelerometer tilt
Expand Down
1 change: 1 addition & 0 deletions bricks/_common/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
#define MICROPY_PY_BUILTINS_SLICE (PYBRICKS_OPT_EXTRA_LEVEL1)
#define MICROPY_PY_BUILTINS_PROPERTY (0)
#define MICROPY_PY_BUILTINS_MIN_MAX (1)
#define MICROPY_PY_BUILTINS_STR_UNICODE (PYBRICKS_OPT_EXTRA_LEVEL2)
#define MICROPY_PY___FILE__ (0)
#define MICROPY_PY_MICROPYTHON_MEM_INFO (1)
#define MICROPY_PY_GC (PYBRICKS_OPT_EXTRA_LEVEL1)
Expand Down

0 comments on commit 47bb9a7

Please sign in to comment.