I think this is what is happening (you are right about unicode using 2
bytes & that is the explanation):
If the length of your file is even, the EOF character is the last one.
Hence the actual data length is ODD. So you have to add one extra space to
make it even since UNICODE uses 2 bytes to encode each character.
Similarly, if the length of the file is ODD & the EOF being the last
one. The actual data length is EVEN. Hence 2 bytes at a time goes in fine.
--
Umachandar Jayachandran
MCDBA, MCSE + Internet, MCP + Internet, MCSE