From: Pit Capitain Date: 2002-09-11T19:45:52+09:00 Subject: Re: [FXRuby] marshalling objects to the fox registry On 11 Sep 2002, at 15:08, Joel VanderWerf wrote: > The Fox registry lets you save strings between app invocations. I > tried persisting an array by marshalling it to a string and writing > the string to the registry, but when I ran the app again, it choked on > the null chars in the string. Does this mean Fox strings can't have > null chars? > > Does the registry's setAsciiMode method have anything to do with this? > I tried calling setAsciiMode(false), but it didn't seem to help. Hi Joel, I don't know about Fox and its registry but you could try to avoid null chars by using a base64 encoding for the marshalled strings, something like s = [ Marshal.dump( my_object ) ].pack( 'm' ) These strings don't include null or other special characters. To get the marshalled object back you would do my_object = Marshal.load( s.unpack( 'm' )[ 0 ] ) HTH Regards, Pit