Permalink
Browse files

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.
  • Loading branch information...
1 parent 8600971 commit ff4a674fea1ad5cee02695f9c9c3c96d5659c934 @jfirebaugh jfirebaugh committed May 1, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 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

0 comments on commit ff4a674

Please sign in to comment.