What is the impact of line breaks in the encoding process?

Source: Internet
Author: User
When I was reading the PSR-2 documentation, I found that the & quot; php file uses the unxi-style lf linefeed & quot ;. We know that windows: CRLFunix: LFmac: CR, if I use lf for line feed encoding in windows, what will happen? There is another question about how line breaks will affect us...

When I was reading the PSR-2 documentation, I found that "the php file uses the unxi-style lf linefeed ".
We know that,

  • Windows: CRLF

  • Unix: LF

  • Mac: CR

What will happen if I use lf line breaks for encoding in windows?
Another question is, what kind of troubles will the line breaks bring to us? Or what kind of pitfalls will there be in coding?

Reply content:

When I was reading the PSR-2 documentation, I found that "the php file uses the unxi-style lf linefeed ".
We know that,

  • Windows: CRLF

  • Unix: LF

  • Mac: CR

What will happen if I use lf line breaks for encoding in windows?
Another question is, what kind of troubles will the line breaks bring to us? Or what kind of pitfalls will there be in coding?

Line breaks only Mark line breaks, because generally the character encoding is compatible with ASCII, and LF and CR are always 13 of 10 in ASCII, so there is no relevant pitfall in the encoding.

Currently, both IDE and general editors have line breaks. you only need to select the line breaks in the settings, whether in Windows or Linux.

Windows: CRLF, * nix: LF, and early macOS: CR are all default line breaks of the system. it does not mean that such line breaks can only be used in the corresponding system.

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.