This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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.