A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-September/017539.html below:

[Pythonmac-SIG] Mac Python and line-endings

[Python-Dev] RE: [Pythonmac-SIG] Mac Python and line-endingsGuido van Rossum guido@python.org
Tue, 18 Sep 2001 15:03:10 -0400
> I'm not aware of any type of text file, that supports switching line
> deliminators inside of the same file....
> 
> Now that doesn't mean it couldn't exist, but logically that would be
> a strange file....
> 
> I think it's a even bet that a file would have the same deliminator
> throughout the file.

I have observed this on Windows, where the text editor in VC++ can
read files with \n line endings, and doesn't change those when it
writes the file back, but always adds \r\n to lines it adds.  So if
you edit a file containing only \n line endings, inserting a few
lines, you have mixed line endings.

Also, Java supports this, and the algorithm to support it is not
difficult: to read a line, read until you see either \r or \n; if you
see \r, peek one character ahead and if that's a \n, include it in the
line.

(Haven't had the time to read the whole proposal, but a Java style
text file implementation has been in my wish list for a long time.)

--Guido van Rossum (home page: http://www.python.org/~guido/)



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4