IO.readlines returns native line endings
----------------------------------------

                 Key: JRUBY-2140
                 URL: http://jira.codehaus.org/browse/JRUBY-2140
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.1RC2
         Environment: Windows XP Pro, Java 1.5
            Reporter: Daniel Berger


On MS Windows the IO.readlines method is retaining the "\r\n" line endings. In 
MRI the line ending is always "\n". To demonstrate, create a simple text file 
in notepad and run this:
{noformat}
IO.readlines('test.txt').each{ |line|
   p line
   p line.length
}
{noformat}
With MRI:
{noformat}
C:\>ruby readlines_test.rb
"Line one\n"
9
"Line two\n"
9
{noformat}
With JRuby
{noformat}
C:\>jruby readlines_test.rb
"Line one\r\n"
10
"Line two\r\n"
10
{noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to