summaryrefslogtreecommitdiff
path: root/strftime.c
diff options
context:
space:
mode:
authorS-H-GAMELINKS <gamelinks007@gmail.com>2022-11-15 13:21:45 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-12-02 01:31:27 +0900
commit1a64d45c67feed7355d6b53746801acb319394a4 (patch)
tree7de928b38b2fc079d91120f22d89b92ca6a3e110 /strftime.c
parent7bc63d6f430422535f4dd460a98f3a90578e524c (diff)
downloadruby-1a64d45c67feed7355d6b53746801acb319394a4.tar.gz
Introduce encoding check macro
Diffstat (limited to 'strftime.c')
-rw-r--r--strftime.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/strftime.c b/strftime.c
index a8a688608e..33e7d3fdb8 100644
--- a/strftime.c
+++ b/strftime.c
@@ -66,6 +66,7 @@
#include <math.h>
#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;
}