It seems like you're using the wrong encoding for the file in this case.
If you write a file in one encoding and read it in a different encoding, you will end up getting nonsensical characters made up of the same bytes being interpreted in the wrong way IMHO.
Hope this helps!