I am trying to zip up text a file in java, the file includes newline characters, it zips successfully, but when I open it up in winzip, the newline characters are gone, can anyone please advise how to resolve this?
Is this code executed on a Linux machine, and is the text file then opened in Notepad? Because Linux uses only \n for line breaks, and Notepad is notorious for only supporting the \r\n combination that Windows uses. Other text editors, including Microsoft's own WordPad (ok, technically not a text editor, but it can handle text files), are a lot better. Notepad++ is often recommended.