I am wondering that when I open a file in notepad. I see a continuous line without any carriage return/line feed.
I made a java program to read the file. When I split the data from file by using \n or System.getProperty("line.separator");. I see lots of lines.
I found in hex editor that file has ‘0A’ for new line ( used in UNIX ) and it appears as a rectangle in Notepad.
Well, my question is that if it doesn’t have ‘0D’ and ‘OA’ ( used in Windows for carriage return and line feed ). How my java program is splitting the data into lines? It should not split it.
Anyone have any idea?
Java internally works with Unicode.
(http://en.wikipedia.org/wiki/Newline)
That’s why it interprets
\nas newline.