简体   繁体   中英

Can anybody identify this Json-like TLV Data Format?

I'm currently working on a project that involves migrating a legacy database over to a new schema. The old database has records of orders that have been placed and a single column containing the shopping cart.

The problem is the cart is in a format I'm not familiar with, it's kind of like JSON, but obviously some kind of TLV format.

If possible, I need one of the following

  • Can anyone identify the format?
  • Does anyone know of a library that will parse it in C#?
  • A code sample for how to go about parsing it myself

Format examples:

a:1:{i:0;a:3:{s:4:"item";s:37:"this is the product identifier";s:5:"price";s:5:"65.00";s:4:"when";s:6:"signup";}}

or the following for an empty order

a:0:{}

Looks like serialized order data from Commerce Server. If so, it's not any kind of "standard" format that I know of, but unique to CS.

Ok I've managed to work it out, this is actually the format returned by php's serialize() method.

I've used the library from http://csphpserial.sourceforge.net/ in order to convert this back to an ArrayList of Hashtables (library's choice) and can then parse from there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM