[thelist] Binary file manipulation in PHP

Luther, Ron Ron.Luther at hp.com
Wed Feb 13 10:05:42 CST 2008

Rick den Haan asked:

>>A long, long time ago, some developer at my company invented a custom file format.

>>I can open the file using fopen(), and read out its contents using fread()
>>and fseek(), but how do I convert something that Notepad thinks looks
>>like "¬" into a version number?

Hi Rick,

Only a guess, but this sounds like you may well be running into a character set
issue.  My first guess (is this thing is *that* old) is that this sounds like an
old school mainframe extract format ... so the data may be EBCDIC instead of ASCII.

Try getting the ascii code for that odd character and check it that value in a few
other (likely candidate) character sets to see if they yield more likely values.


And any day that gives you an excuse to say 'ipsy-dick' is a _good_ day!  ;-)

More information about the thelist mailing list