From 482d0840c08627c97a7049644852e6fbb843b8a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B1=86=E8=B1=86?= <1491766334@qq.com> Date: Fri, 15 Aug 2025 16:24:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:lib=20str=20=E7=BC=96=E8=AF=91=E8=AD=A6?= =?UTF-8?q?=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/src/lstrlib_exts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/src/lstrlib_exts.c b/lua/src/lstrlib_exts.c index 95d62d4bd..65de20809 100644 --- a/lua/src/lstrlib_exts.c +++ b/lua/src/lstrlib_exts.c @@ -123,7 +123,7 @@ int luat_str_utf8_to_ucs2(char* source, size_t source_len, char* dst, size_t dst // 首先是不是单字节 if (source[i] & 0x80) { // 非ASCII编码 - if (source[i] && 0xE0) { // 1110xxxx 10xxxxxx 10xxxxxx + if (source[i] & 0xE0) { // 1110xxxx 10xxxxxx 10xxxxxx unicode = ((source[i] & 0x0F) << 12) + ((source[i+1] & 0x3F) << 6) + (source[i+2] & 0x3F); dst[tmplen++] = (unicode >> 8) & 0xFF; dst[tmplen++] = unicode & 0xFF;