Converting Text Files From One Encoding or Operating System to Another

Unicode UTF-8 or UTF-16 to ASCII on various platforms

LF = Line Feed

CR = Carriage Return

(FTP will change formats automatically in ASCII mode, but not in binary mode)

  • To convert a Microsoft Windows file to Linux or a classic Macintosh file you subtract.
  • To convert a Linux or a classic Macintosh file to a Microsoft Windows file you add.
  • To convert between Linux and classic Macintosh files you substitute.

 

  • For the conversion to a classic Macintosh, you subtract the LF of the CRLF combination
  • For the conversion to Linux (read Mac OS X, also), you subtract the CR of the CRLF combination
  • For conversion from a classic Macintosh to Windows, you add a LF immediately after each CR.
  • To convert a Linux file to a Windows file, you add a CR immediately before each LF.
  • When going from Linux to the classic Mac, you substitute the LF for the CR.
  • When going from the classic Mac to Linux, you substitute the CR for the LF.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s