[sync] byte/binary output

Chuck Hagenbuch chuck at horde.org
Tue Dec 2 14:54:45 PST 2003


Anthony-

I've done most of what I can do on the Encoder with the information I have write
now, and cleaned up the decoder as much as I could. I feel like I'm coming at
the ByteOutput stuff from not knowing quite what it's supposed to be doing.
Would these functions help at all?

function bin2asc ($temp) {
  $len = strlen($temp);
  for ($i=0;$i<$len;$i+=8) $data.=chr(bindec(substr($temp,$i,8)));
  return $data;
}

function asc2bin ($temp) {
  $len = strlen($temp);
  for ($i=0; $i<$len; $i++) $data.=sprintf("%08b",ord(substr($temp,$i,1)));
  return $data;
}

They're from http://us4.php.net/pack - no charset conversion involved, though we
do have String::convertCharset() in Horde; I'm just not sure where it should
get called in here.

If you could take a look at the current state of things, and either have some
time to work on it yourself, or send a message to the list describing how
things need to work, that'd be great.

Also, do you happen to have any examples of either syncml or wbxml requests that
we can use to test encoding/decoding?

-chuck

--
Charles Hagenbuch, <chuck at horde.org>
"I'm really... I'm not too fascinated by green food." - Average Joe


More information about the sync mailing list