CR, LF, CR/LF press enter to switch from Captain's Log

Source: Internet
Author: User
Tags ftp client

Transferred from Captain log

In text processing, CR, LF, CR/LF are linefeeds used on different operating systems.

Dos and windows use carriage return + line feed CR/LF to represent the next line,
In UNIX/Linux, the line break LF indicates the next line,
The mac OS system uses the carriage return (CR) to indicate the next line.
CR is represented by the 'R' symbol. the ASCII code in decimal format is 13 and the hexadecimal code is 0x0D;
LF uses the 'N' symbol, the ASCII code is 10, and the hexadecimal value is 0x0A.
Therefore, on Windows, line breaks are represented by 0d 0a in text files, while on UNIX and Apple platforms, line breaks are represented by 0a or 0d in one byte.
Generally, the Runtime library on the operating system automatically determines the line feed format of text files. for example, if a program runs on windows, a text file in CR/LF line feed format is generated, and a text file in LF format is generated when it runs on Linux.
Using another line break file on one platform may cause unexpected problems, especially when editing program code. sometimes the code is displayed normally in the editor, but an error occurs due to line breaks during editing.
Many text/code Editors Use the line break Conversion Function to swap line breaks in text files in different formats.
When FTP software is used to transfer files between different platforms, some FTP client programs automatically convert the line feed format in ascii text transmission mode. the number of bytes transmitted may change. if you do not want to modify the original file via ftp, you can use bin mode (binary mode) to transfer text.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.