What is the specification of Julia for reading text files which have newlines (e.g. "\n"
, "\r\n"
, "\r"
)? My program has a bug related to the different behavior between operating systems about newlines.
I made a following file lf.txt
on macOS by:
write("lf.txt", "---\nhello:\n...\n")
then added and committed and pushed by Git. On Windows, I pulled it by Git and read it by:
str = read("lf.txt", String)
but got
julia> @show str
str = "---\r\nhello:\r\n...\r\n"
Why? Does Git something wrong?