From 1ba1e9bef9707da37459039bdb3e5336e65162cc Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Mon, 27 Oct 2025 09:52:58 +0100 Subject: [PATCH] Use locale indepenent version of `islapha` --- ext/json/ext/parser/parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/json/ext/parser/parser.c b/ext/json/ext/parser/parser.c index 297031dc..2522c562 100644 --- a/ext/json/ext/parser/parser.c +++ b/ext/json/ext/parser/parser.c @@ -124,7 +124,7 @@ static VALUE rstring_cache_fetch(rvalue_cache *cache, const char *str, const lon return Qfalse; } - if (RB_UNLIKELY(!isalpha((unsigned char)str[0]))) { + if (RB_UNLIKELY(!rb_isalpha((unsigned char)str[0]))) { // Simple heuristic, if the first character isn't a letter, // we're much less likely to see this string again. // We mostly want to cache strings that are likely to be repeated. @@ -176,7 +176,7 @@ static VALUE rsymbol_cache_fetch(rvalue_cache *cache, const char *str, const lon return Qfalse; } - if (RB_UNLIKELY(!isalpha((unsigned char)str[0]))) { + if (RB_UNLIKELY(!rb_isalpha((unsigned char)str[0]))) { // Simple heuristic, if the first character isn't a letter, // we're much less likely to see this string again. // We mostly want to cache strings that are likely to be repeated.