Hello,
I am trying to read C-strings from a binary Palm file 'address.dat', but am having no luck with it. I have used the following code (Perl) to successfully read a C-string from address.dat:
sub readC {
my $x;
read (CF, $x, 1);
$x = unpack "C", $x;
if ($x == 0xFF) {
$x = &readShort();
}
if ($x == 0) {
return "";
}
read (CF, $_, $x);
replace carriage returns
s/[\r]//g;
return $_;
}
I've tried to port the above code to PHP, but the conversion was unsuccessful. Can anyone shed some light on this.
Thanks.