Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以告诉 Windows 中的 Ruby 只使用 \n 而不是 r\n?我遇到了一个问题,即使用 \r\n 保存文件并导致它无法正常运行。我可以更改某个设置来解决此问题吗?
简单的攻击:
File.open("foo.txt", "w") do |fd| fd.write "this\nis\a\test\n" end
当我在 hexedit 中打开它时:
00000000 74 68 69 73 0A 69 73 0A 61 0A 74 65 73 74 0A ^^ ^^ ^^ ^^ \n \n \n \n