From ff4a674fea1ad5cee02695f9c9c3c96d5659c934 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Mon, 30 Apr 2012 18:05:15 -0700 Subject: [PATCH] Fix Marshal.dump for string encoding The :E or :encoding symbol needs to be placed in the symlink table like any other symbol. Fixes #1681. --- kernel/common/marshal19.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/common/marshal19.rb b/kernel/common/marshal19.rb index e34e14c03b..562cbb8d46 100644 --- a/kernel/common/marshal19.rb +++ b/kernel/common/marshal19.rb @@ -29,11 +29,11 @@ def serialize_encoding?(obj) def serialize_encoding(obj) case enc = Rubinius::Type.object_encoding(obj) when Encoding::US_ASCII - serialize_symbol(:E) + false.__marshal__(self) + :E.__marshal__(self) + false.__marshal__(self) when Encoding::UTF_8 - serialize_symbol(:E) + true.__marshal__(self) + :E.__marshal__(self) + true.__marshal__(self) else - serialize_symbol(:encoding) + serialize_string(enc.name) + :encoding.__marshal__(self) + serialize_string(enc.name) end end end