haha, oh boy, windows replaces LF with CR-LF so you have to open files in wb mode, not just w mode.