-
-
Save anonymous/33d028c108081e9c19f4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File.open("#{__dir__}/out.txt", universal_newline: true) do |file| | |
file.each_line do |line| | |
p line | |
end | |
end | |
# gives output | |
# "I am a good boy \\r \\r\\n\n" | |
# "I am a good girl \\r\\n \\r\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2.1.2 :004 > "foo \r \r\n".encode(universal_newline: true) | |
=> "foo \n \n" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I am a good boy \r \r\n | |
I am a good girl \r\n \r |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment