summaryrefslogtreecommitdiff
path: root/py/objstrunicode.c
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2018-07-11 16:45:30 -0400
committerDan Halbert <halbert@halwitz.org>2018-07-11 16:45:30 -0400
commit7c219600a246d8956d0b23ea3f5d125a820e6b6a (patch)
tree4cf793a66284322d48a8f430815c31cd1c9ffa1d /py/objstrunicode.c
parent4962468ffffac9ec4e36b2b1fc3f132516df3127 (diff)
parent25ae98f07cb3c4488cb955403dfe56b8bb8db6f0 (diff)
WIP: after merge; before testing
Diffstat (limited to 'py/objstrunicode.c')
-rw-r--r--py/objstrunicode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/py/objstrunicode.c b/py/objstrunicode.c
index a243022a7..ca41a7baa 100644
--- a/py/objstrunicode.c
+++ b/py/objstrunicode.c
@@ -104,7 +104,7 @@ STATIC mp_obj_t uni_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
case MP_UNARY_OP_BOOL:
return mp_obj_new_bool(str_len != 0);
case MP_UNARY_OP_LEN:
- return MP_OBJ_NEW_SMALL_INT(unichar_charlen((const char *)str_data, str_len));
+ return MP_OBJ_NEW_SMALL_INT(utf8_charlen(str_data, str_len));
default:
return MP_OBJ_NULL; // op not supported
}
@@ -216,7 +216,7 @@ STATIC mp_obj_t str_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) {
++len;
}
}
- return mp_obj_new_str((const char*)s, len, true); // This will create a one-character string
+ return mp_obj_new_str_via_qstr((const char*)s, len); // This will create a one-character string
} else {
return MP_OBJ_NULL; // op not supported
}
@@ -291,7 +291,7 @@ STATIC mp_obj_t str_it_iternext(mp_obj_t self_in) {
if (self->cur < len) {
const byte *cur = str + self->cur;
const byte *end = utf8_next_char(str + self->cur);
- mp_obj_t o_out = mp_obj_new_str((const char*)cur, end - cur, true);
+ mp_obj_t o_out = mp_obj_new_str_via_qstr((const char*)cur, end - cur);
self->cur += end - cur;
return o_out;
} else {