diff options
| author | Saikari <[email protected]> | 2026-01-17 03:43:55 +0300 |
|---|---|---|
| committer | Saikari <[email protected]> | 2026-01-17 03:43:55 +0300 |
| commit | d83c306af108ef93fc08b9db1c42469c7f14372f (patch) | |
| tree | 46e28e26cb9649e0b6c0967cb11f413b735c1f6d /core/src/xmake/string | |
| parent | 424d7de3637812c82adbc2cd0419c842b1991be4 (diff) | |
assume we check char
Diffstat (limited to 'core/src/xmake/string')
| -rw-r--r-- | core/src/xmake/string/case.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/core/src/xmake/string/case.c b/core/src/xmake/string/case.c index aeadc4e62..858d4be08 100644 --- a/core/src/xmake/string/case.c +++ b/core/src/xmake/string/case.c @@ -79,8 +79,13 @@ static tb_int_t xm_string_case(lua_State* lua, tb_bool_t lower) { tb_uint32_t* p = (tb_uint32_t*)dst_data; tb_size_t n = (tb_size_t)dst_size / 4; while (n--) { - if (*p < 0x10000) - *p = (lower? towlower((wint_t)*p) : towupper((wint_t)*p)); + if (lower) { + if (iswupper((wint_t)*p)) + *p = towlower((wint_t)*p); + } else { + if (iswlower((wint_t)*p)) + *p = towupper((wint_t)*p); + } p++; } #endif |
