From: dima Date: 2007-06-18T15:55:02+09:00 Subject: Re: healp reading / writing binary strings. The string that you can't understand contains the unprintable characters. It is probably that you got if from some type of serialization. You can say that is in a binary format but it's not so good definition because everything is in binary format - some we can read and some we can not. For the second question there is lot of strategies how to store the array in a file and it most depend what do you want to do latter with that stored information. Nowadays is custom to use xml serialization, but you can use YAML or JSON. They are all human readable. On Jun 18, 3:52 am, Melissa Silas wrote: > Hey, I'm looking for some help with reading / writing binary string. > Just need some help understanding what exactly is going on.. > > if I have a string like: > str = "\t\005\001\006\afoo\006\abar" > > Or if I have something like: > str = > "\t\025\001\004\001\004\002\004\003\004\004\004\005\004\006\004\a\004\b\004\t\004\n" > > What exactly kind of format is that? How do I parse it / read binary > data from it? And how can I write the same type of string from say an > array? ["foo","bar"]? > > thanks > Melissa > > -- > Posted viahttp://www.ruby-forum.com/.