Any ideas out there? On Sep 24, 9:14 am, Andy <andym...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''ve getting data like this: > > <![CDATA[a:1:{i:0;s:6:"Sometext";}]]> > > I know in PHP I can unserialize and decode, but I''m not sure the best > way to do it in Rails. > > I''m already parsing the XML using REXML so I''m hoping to continue to > use that. > > Thanks, > Andy
Does anyone know how to parse this kind of data in Ruby or REXML? On Sep 28, 8:19 am, Andy <andym...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Any ideas out there? > > On Sep 24, 9:14 am, Andy <andym...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I''ve getting data like this: > > > <![CDATA[a:1:{i:0;s:6:"Sometext";}]]> > > > I know in PHP I can unserialize and decode, but I''m not sure the best > > way to do it in Rails. > > > I''m already parsing the XML using REXML so I''m hoping to continue to > > use that. > > > Thanks, > > Andy > >
Hassan Schroeder
2009-Oct-12 17:48 UTC
Re: How can I parse encoded and serialized XML with REXML?
On Mon, Sep 28, 2009 at 5:19 AM, Andy <andymilk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:>> I''ve getting data like this: >> >> <![CDATA[a:1:{i:0;s:6:"Sometext";}]]> >> >> I know in PHP I can unserialize and decode, but I''m not sure the best >> way to do it in Rails.If you know that, you presumably know how it''s being encoded to start with. I don''t recognize that format at all, so you might want to provide a little more info, like WTF is it? Or e.g. what PHP function turns XML into the above, or extracts XML from it? -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan