Skip to content

Commit 89452be

Browse files
committed
Update comments - now aiming for UTF-8 rather than PEP 393 strings
1 parent c239f50 commit 89452be

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

py/objstr.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ typedef struct _mp_obj_str_t {
3030
machine_uint_t hash : 16;
3131
// len == number of bytes used in data, alloc = len + 1 because (at the moment) we also append a null byte
3232
machine_uint_t len : 16;
33-
char flags; //PEP 393-style flags
34-
const void *data; //Character data may be 1-byte, 2-bytes, or 4-bytes per character depending on flags
33+
char flags; //Currently unused, always 1. Will later get markers eg ASCII-only.
34+
const void *data; //Character data is encoded UTF-8 and should not be blindly indexed.
3535
} mp_obj_str_t;
3636

3737
#define MP_DEFINE_STR_OBJ(obj_name, str) mp_obj_str_t obj_name = {{&mp_type_str}, 0, sizeof(str) - 1, 1, (const byte*)str};

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy