You could silently make all #cr methods write/return LFs instead, but that would break existing code that actually expects messages like Character class>>#cr or Character class>>#lf to use the character they're named after (Smalltalk/X actually does something like this and it's caused me grief).
A safer way would be adding a new message like #lineEnding/#newLine defined everywhere #cr and #lf are and change uses of #cr as a line ending (for example, splitting on it, or sending #cr to a write stream) in the image to the new message. > Sent: Friday, July 08, 2016 at 5:43 AM > From: stepharo <steph...@free.fr> > To: pharo-dev@lists.pharo.org > Subject: Re: [Pharo-dev] lineConversion for WriteStream > > > > So it looks to me like LF wins! > > It may take a while and some effort, but can we agree on a three point > > strategy? > > 1. Default CR line ending must change! > > 2. Change it to LF. > > 3. Default auto-conversion of "text" input to LF? > Would be so nice :) > > > > > > [1] https://en.wikipedia.org/wiki/Newline#History > > [2] https://blog.codinghorror.com/the-great-newline-schism/ > > [3] > > http://www.zdnet.com/article/microsoft-and-canonical-partner-to-bring-ubuntu-to-windows-10/ > > [4] > > https://insights.ubuntu.com/2016/03/30/ubuntu-on-windows-the-ubuntu-userspace-for-windows-developers/ > > > > cheers -ben > > > >>> Anyway; this is not system-breaking problem, just annoying. > >>> > >>> Peter > >>> > >>> On Thu, May 26, 2016 at 2:50 PM, Sven Van Caekenberghe <s...@stfx.eu> > >>> wrote: > >>> > >>>> On 26 May 2016, at 14:06, Peter Uhnák <i.uh...@gmail.com> wrote: > >>>> > >>>> > >>>> > >>>> On Thu, May 26, 2016 at 1:40 PM, Sven Van Caekenberghe <s...@stfx.eu> > >>>> wrote: > >>>> > >>>>> On 26 May 2016, at 13:29, Peter Uhnák <i.uh...@gmail.com> wrote: > >>>>> > >>>>>> In general I would say that you should write either something > >>>>>> platform specific or you write something specific > >>>>> Except that I cannot do that because the system doesn't support neither. > >>>>> And the fact that the default line ending is CR is just bullshit… it's > >>>>> 2016, not 1986. > >>>> Yes, that CR is from days long gone ;-) > >>>> > >>>>> or #cr #lf or #crlf as needed, and/or make that last one a parameter > >>>>> (OSPlatform current lineEnding). > >>>> I am piping unknown content into the file, thus the need for > >>>> `lineEndConvention:` and the reason of this entire thread. So as I said, > >>>> the system doesn't support it. > >>>> I know I can use #lf or whatnot, but I am not creating the content, I am > >>>> saving it. > >>>> > >>>> Peter > >>> Well, maybe I don't understand your use case, but if you do not know what > >>> is inside, why not save it as is, binary even, not doing any conversions ? > >>> > >>> > >>> > >> > > > > >