mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
fix a bug in PikaStdData_String___setitem__
This commit is contained in:
parent
27ebfb049f
commit
ba42a3924c
@ -124,6 +124,13 @@ void PikaStdData_String___setitem__(PikaObj *self, Arg *__key, Arg *__val)
|
||||
#if PIKA_STRING_UTF8_ENABLE
|
||||
// int ulen = _pcre_utf8_strlen(str, len);
|
||||
int len2 = strlen(val);
|
||||
int is_invalid = _pcre_valid_utf8(val, len2);
|
||||
if (is_invalid >= 0)
|
||||
{
|
||||
obj_setErrorCode(self, __LINE__);
|
||||
__platform_printf("Error String invalid\r\n");
|
||||
return;
|
||||
}
|
||||
int ulen_val = _pcre_utf8_strlen(val, len2);
|
||||
if (ulen_val != 1)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user