summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/string.c b/string.c
index 0a5f802452..c065a8e2b6 100644
--- a/string.c
+++ b/string.c
@@ -2451,6 +2451,7 @@ str_substr(VALUE str, long beg, long len, int empty)
str2 = str_new_shared(rb_obj_class(str2), str2);
RSTRING(str2)->as.heap.ptr += ofs;
RSTRING(str2)->as.heap.len = len;
+ ENC_CODERANGE_CLEAR(str2);
}
else {
if (!len && !empty) return Qnil;