summaryrefslogtreecommitdiff
path: root/marshal.c
diff options
context:
space:
mode:
Diffstat (limited to 'marshal.c')
-rw-r--r--marshal.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/marshal.c b/marshal.c
index be33546a89..3b5054c007 100644
--- a/marshal.c
+++ b/marshal.c
@@ -424,10 +424,11 @@ w_symbol(ID id, struct dump_arg *arg)
rb_raise(rb_eTypeError, "can't dump anonymous ID %ld", id);
}
encidx = rb_enc_get_index(sym);
- if (encidx == rb_usascii_encindex()) {
+ if (encidx == rb_usascii_encindex() ||
+ rb_enc_str_coderange(sym) == ENC_CODERANGE_7BIT) {
encidx = -1;
}
- else if (rb_enc_str_coderange(sym) != ENC_CODERANGE_7BIT) {
+ else {
w_byte(TYPE_IVAR, arg);
}
w_byte(TYPE_SYMBOL, arg);