summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/string.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/string.h b/internal/string.h
index cd1e8d7929..dd5e20c0c6 100644
--- a/internal/string.h
+++ b/internal/string.h
@@ -50,6 +50,13 @@ rb_str_enc_fastpath(VALUE str)
return rb_str_encindex_fastpath(ENCODING_GET_INLINED(str));
}
+static inline rb_encoding *
+rb_str_enc_get(VALUE str)
+{
+ RUBY_ASSERT(RB_TYPE_P(str, T_STRING));
+ return rb_enc_from_index(ENCODING_GET(str));
+}
+
/* string.c */
VALUE rb_str_dup_m(VALUE str);
VALUE rb_fstring(VALUE);