I maintain a Delphi program which uses typed binary files as its native file format. After upgrading from Turbo Delphi to Delphi 2010, all chars in the record type being stored started being stored with 2 bytes rather than one.
The data types being stored are char
and array[1..5] of char
.
So before, part of the file looked like:
4C 20 20 20 4E 4E 4E 4E
Now it looks like:
4C 00 20 00 20 00 20 00 4E 00 4E 00 4E 00 4E 00
First of all, why did this happen in the first place?
Secondly, how can I still read my files, keeping in mind that there are now old files and new files floating around in the universe?
I will monitor this question obsessively after lunch. Feel free to ask for more information in comments.