Skip to content

Commit

Permalink
Fix Marshal.dump for string encoding
Browse files Browse the repository at this point in the history
The :E or :encoding symbol needs to be placed in the
symlink table like any other symbol.

Fixes #1681.
  • Loading branch information
jfirebaugh committed May 1, 2012
1 parent 8600971 commit ff4a674
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kernel/common/marshal19.rb
Expand Up @@ -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
Expand Down

0 comments on commit ff4a674

Please sign in to comment.