On Sep 24, 2:14 pm, Andy <[email protected]> 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.
>
Well the CDATA bit is just XML's way of conveniently storing chunks of
data with arbitrary contents, so REXML should handle that. What's
inside looks like a php serialized object. Unsurprisingly ruby does
not come with functions to deal with serialized php objects (and I
suspect php doesn't come with libraries to parse ruby's serialized
object format). If you're lucky there will be a gem out there (maybe
http://github.com/jqr/php-serialize ) that already does this, if not
you will just have to implement the unserializing yourself.
Fred
> Thanks,
> Andy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---