Feature request: Detect line encoding problems
This is a feature which would have saved me hours of debugging.
If you give ruby a file with old mac line endings, ruby does not recognise them as new lines. I think this is ok because it's easy to convert to a format that ruby can deal with, but it would be great if ruby would recognise all these \r characters without any new lines and give a warning that there's probably an encoding problem.
For example, given this code:
instead of returning:
test.rb:1: syntax error, unexpected keyword_def, expecting end-of-input
end puts x
it would return
test.rb: Warning: Have you got the wrong line endings in this file? Both UNIX-style (\n) and Windows-style (\r\n) are recognised by ruby, but your file has something different.
Not really an urgent feature but it would be helpful in some cases. Shouldn't be too hard to implement
#2 Updated by Nobuyoshi Nakada over 3 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100