in reply to UTF-16 on WinXP written by Perl shows whitespaces.
Could you please try to use your script to copy a file without any modifications, and then do a binary comparison of input and output file?