From 1a64d45c67feed7355d6b53746801acb319394a4 Mon Sep 17 00:00:00 2001 From: S-H-GAMELINKS Date: Tue, 15 Nov 2022 13:21:45 +0900 Subject: Introduce encoding check macro --- strftime.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'strftime.c') diff --git a/strftime.c b/strftime.c index a8a688608e..33e7d3fdb8 100644 --- a/strftime.c +++ b/strftime.c @@ -66,6 +66,7 @@ #include #include "internal.h" +#include "internal/encoding.h" #include "internal/string.h" #include "internal/vm.h" #include "ruby/encoding.h" @@ -270,9 +271,9 @@ rb_strftime_with_timespec(VALUE ftime, const char *format, size_t format_len, } if (enc && - (enc == rb_usascii_encoding() || - enc == rb_ascii8bit_encoding() || - enc == rb_locale_encoding())) { + (rb_is_usascii_enc(enc) || + rb_is_ascii8bit_enc(enc) || + rb_is_locale_enc(enc))) { enc = NULL; } -- cgit v1.2.1