This week's book giveaway is in the Java in General forum. We're giving away four copies of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 and have ishori Sharan & Adam L Davis 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.