summaryrefslogtreecommitdiff
path: root/core/src/xmake/string
diff options
context:
space:
mode:
authorSaikari <[email protected]>2026-01-17 04:07:23 +0300
committerSaikari <[email protected]>2026-01-17 04:07:23 +0300
commite7ab18bef196961d784d0e98746bd41c3453a3ad (patch)
tree8da31db0df4ad089065a88dee128e92c9e3d3489 /core/src/xmake/string
parentb5f93e02d0e28b694fe452ef868620fffbd7872b (diff)
refactor: replace setlocale with tb_setlocale for locale initialization
Diffstat (limited to 'core/src/xmake/string')
-rw-r--r--core/src/xmake/string/case.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/core/src/xmake/string/case.c b/core/src/xmake/string/case.c
index ee20b4a9b..1c2341cb1 100644
--- a/core/src/xmake/string/case.c
+++ b/core/src/xmake/string/case.c
@@ -34,9 +34,7 @@
#if defined(TB_CONFIG_OS_WINDOWS)
# include <windows.h>
#endif
-#if defined(TB_CONFIG_LIBC_HAVE_SETLOCALE)
-# include <locale.h>
-#endif
+#include "tbox/libc/stdlib/setlocale.h"
/* //////////////////////////////////////////////////////////////////////////////////////
* helper
@@ -46,10 +44,8 @@ static tb_int_t xm_string_case(lua_State* lua, tb_bool_t lower) {
// check
tb_assert_and_check_return_val(lua, 0);
-#if defined(TB_CONFIG_LIBC_HAVE_SETLOCALE)
- // set locale to utf8
- setlocale(LC_ALL, "");
-#endif
+ // init locale
+ tb_setlocale();
// get the string
size_t size = 0;