# Marshal question

**URL:** <https://www.ruby-forum.com/t/marshal-question/123590>\
**Category:** Ruby\
**Created:** [December 19, 2007, 12:22am UTC](https://www.ruby-forum.com/t/marshal-question/123590 "2007-12-19T00:22:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![polypus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b5ac83/32.png) [@polypus](https://www.ruby-forum.com/u/polypus)\
**Post date:** [December 19, 2007, 12:22am UTC](https://www.ruby-forum.com/t/marshal-question/123590/1 "2007-12-19T00:22:26Z")

</div>

hi,

is there some character or sequence of characters which is guaranteed  
_not_ to occur in a string produced by Marshal.dump on some arbitrary  
object hierarchy.

thanks,  
\_c

---

<div class="post-metadata">

**Author:** ![polypus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b5ac83/32.png) [@polypus](https://www.ruby-forum.com/u/polypus)\
**Post date:** [December 19, 2007, 12:39am UTC](https://www.ruby-forum.com/t/marshal-question/123590/2 "2007-12-19T00:39:14Z")

</div>

Christophe M. wrote:

> hi,
> 
> is there some character or sequence of characters which is guaranteed  
> _not_ to occur in a string produced by Marshal.dump on some arbitrary  
> object hierarchy.

Think not. If you do:

result = Marshal.dump(some\_sequence\_of\_characters)

then the characters of the string some\_sequence\_of\_characters are going  
to be embedded in the result string.

For example:

irb(main):001:0\> Marshal.dump(“1234”)  
=\> “\004\b”\t1234"  
irb(main):002:0\> Marshal.dump("\001\002\003\004")  
=\> “\004\b”\t\001\002\003\004"
