欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

VisualStudio修改文本文件的line ending

程序员文章站 2022-06-02 09:54:17
...

 

 

官方文档:

https://msdn.microsoft.com/en-us/library/dd409797.aspx

 

In Visual Studio you can use the File/Advanced Save Options settings to determine the type of line break characters you want. You can also change the encoding of a file with the same settings.

VisualStudio修改文本文件的line ending
            
    
    博客分类: VisualStudio VS Note

If you have certain types of development settings (Visual Basic, F#, Web Development) you may not see Advanced Save Options on the menu. To change your settings (for example to General), open Tools / Import and Export Settings. For more information, see Customizing Development Settings in Visual Studio.

In Visual Studio the following characters are interpreted as line breaks:

  • CRLF: Carriage return + line feed, Unicode characters 000D + 000A

  • LF: Line feed, Unicode character 000A

  • NEL: Next line, Unicode character 0085

  • LS: Line separator, Unicode character 2028

  • PS: Paragraph separator, Unicode character 2029

Text that is copied from other applications keeps the original encoding and line break characters. For example, when you copy text from Notepad and paste it into a text file in Visual Studio, the text has the same settings that it had in Notepad.

When you open a file that has a different line break characters, you may see a dialog box that asks whether the inconsistent line break characters should be normalized and which type of line breaks to choose.

相关标签: VS