http://bugs.winehq.org/show_bug.cgi?id=26281
--- Comment #1 from Sagawa sagawa.aki+winebugs@gmail.com 2011-03-02 08:48:47 CST --- Created an attachment (id=33504) --> (http://bugs.winehq.org/attachment.cgi?id=33504) proposal patch
The cause of this behavior is exporting a file in text mode. As you probably know, in DOS/Windows text mode, writing "\n" is converted to "\r\n". For such occasions, outputting WCHAR binary "00 0a" with fwrite() changes into "00 0d 0a" on the file. Then the file has broken format.
I attach a proposal patch. The patch makes a file opened in binary mode and written WCHAR '\r' explicitly.