When reading from a pseudo-terminal via java, I’m seeing “\n\r” in the text. What is that representative of? Note its not “\r\n” which I’m familiar with.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
\nis a line feed (ASCII code 10),\ris a carriage return (ASCII code 13).Different operating systems use different combinations of these characters to represent the end of a line of text. Unix-like operating systems (Linux, Mac OS X) usually use only
\n. MS-DOS and Windows use\r\n(carriage return, followed by a line feed).The code you’re using uses
\n\r(line feed, carriage return). There are operating systems that use that sequence, but probably it’s a mistake and it should have been\r\n.See Newline on Wikipedia.
If you’re programming in Java and you want to know what the newline sequence is for the operating system that your program is running on, you can get the system property
line.separator: