Skip to content

Commit 042f84b

Browse files
committed
For setting default external/internal encoding, loading should be done first
Loading needs to be outside of VM lock.
1 parent 767abaa commit 042f84b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

encoding.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,6 +1614,10 @@ enc_set_default_encoding(struct default_encoding *def, VALUE encoding, const cha
16141614
/* Already set */
16151615
overridden = TRUE;
16161616

1617+
if (!NIL_P(encoding)) {
1618+
enc_check_encoding(encoding); // loads it if necessary. Needs to be done outside of VM lock.
1619+
}
1620+
16171621
GLOBAL_ENC_TABLE_LOCKING(enc_table) {
16181622
if (NIL_P(encoding)) {
16191623
def->index = -1;

0 commit comments

Comments
 (0)