Fix new line characters with Eclipse

One of the most popular differences between operating systems is the new line separators used in each one of them.

Typically, the top three OS out there print new lines this way:

  • Windows - CRLF, \r\n
  • Mac OS X - CR, \r
  • Linux/UNIX - LF, \n

It's normally an issue when working with a text document under different OS (or deploying to servers).

Luckily, there is a function in Eclipse that would help you automatically convert line endings - "Convert Line Delimiters To" under "File"

eclipse-convert-lines

As a Linux user myself I personally prefer the UNIX-style as our servers are always running under some Linux derivative (and it helps mitigating possible issues related to this for version control systems or deploy scripts).

Be Sociable, Share!
  • Twitter
  • Facebook
  • email
  • StumbleUpon
  • Delicious
  • Google Reader
  • LinkedIn
  • BlinkList
del.icio.us Digg DZone Facebook Google Google Reader Magnolia reddit SlashDot Technorati ReadMe.ru Dobavi.com Dao.bg Lubimi.com Ping.bg Pipe.bg Svejo.net Web-bg.com

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>