Re: [dev] Best way to serialize data

From: Douglas S. Bregolin <douglasbregolin_AT_gmail.com>
Date: Mon, 6 Jun 2011 14:36:58 -0300

In the ASCII table there's a "record separator" character (0x1E). At
least I think is better than using '\0'.

On Mon, Jun 6, 2011 at 2:19 PM, Džen <yvldwt_AT_gmail.com> wrote:
> I was wondering about which way would be the easiest/simplest to
> serialize data, f.e. being read via a file or stdin (data being a
> table of x rows and y columns, each cell a string). I thought of
> using NULL bytes as cell delimiters and newline characters as row
> delimiters. This way it wouldn't be possible to use \0 nor \n
> inside the "cells", but I couldn't think of a simpler solution.
>
> Something like:
> a \0 b \0 c \n
> d \0 e \0 f \n
> ...
>
> What would you recommend? How'd you do it?
>
> Reason why I'm asking is because I was wondering how a dmenu-alike
> utility would read data, where each items has multiple values, not
> just one. Kinda like a search utility for table-structured data.
>
> --
> Džen
>
>
Received on Mon Jun 06 2011 - 19:36:58 CEST

This archive was generated by hypermail 2.2.0 : Mon Jun 06 2011 - 19:48:03 CEST