summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--string.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/string.c b/string.c
index bdab6fa143..78ac5591cc 100644
--- a/string.c
+++ b/string.c
@@ -2811,6 +2811,7 @@ str_subseq(VALUE str, long beg, long len)
}
else {
str2 = str_new_shared(rb_cString, str);
+ ENC_CODERANGE_CLEAR(str2);
RSTRING(str2)->as.heap.ptr += beg;
if (RSTRING(str2)->as.heap.len > len) {
RSTRING(str2)->as.heap.len = len;