This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: line endings, file path names


The notion of an OS-dependent 'native' text file format is fundamentally rotten; you all seem to agree on this.

The fact that this legacy has crept into standards is all for the worse, and really not much help; you will anyway always have to manage the character encoding of text files.

Whether or not utilities should do automagical munging of text files is another question.

I've been bitten too many times by 'intelligent' utilities that make uninformed decisions, so I tend to prefer to be in control, i.e., *I* manage character encoding and record separators.

There are utilities that will help you guess if need be, e.g. 'dos2unix' and 'file'. I sometimes use 'file --mime' to assert the proper encoding of text files.

Kind regards
Peter Ring



> -----Original Message-----
> From: cygwin-owner@cygwin.com 
> [mailto:cygwin-owner@cygwin.com]On Behalf
> Of Joachim Achtzehnter
> Sent: 3. august 2006 23:36
> To: cygwin@cygwin.com
> Subject: Re: line endings, file path names
> 
> 
> Hi Corinna,
> 
> You wrote:
> 
> > So, since millions of users have DOS and Mac lineending 
> files, every 
> > system in the world has to support them?
> 
> I'm not suggesting that any system "has to" do anything, as 
> the author or
> funder of a system you can decide what you want it to do. I'm 
> trying to
> persuade you that it would be better for its users, and 
> indirectly even for
> you because these kind of discussions would go away, if it did.
> 
> > Sed does not support CRLF and CR line endings on POSIX systems.
> 
> And it can to some extent get away with this because 
> communication programs
> like ftp and http clients are supposed to translate line 
> endings to the
> native convention when downloading text files from other systems. This
> doesn't always work because of user errors and incorrect file 
> types, but on
> a native POSIX system one can at least legitimately assume 
> that most files
> will have native line endings. In the case of Cygwin such an 
> assumption is
> simply not warranted because Cygwin always runs on systems 
> where CRLF is
> the native convention.
> 
> > It just has a bad hack for Windows systems which is also enabled for
> > Cygwin.
> 
> It is "bad" only when compared to a possible world without 
> CRLF, but we, at
> least most of us, don't have the luxury of living in such a world.
> 
> Software developers are often faced with requirements that 
> seem less than
> desirable from an aesthetic point of view and we have to get 
> things working
> in spite of it. This is one of those cases.
> 
> > On other systems you have to take the official route over 
> dos2unix or
> > recode or whatever.
> 
> As I tried to explain above, at least on those other systems 
> the need for
> dos2unix might be the exception instead of the rule. In spite of this,
> given that CRLF platforms are now so wide-spread and given 
> how systems are
> now so inter-connected, even UNIX users are likely to benefit 
> from text
> processing tools that tolerate both conventions, c.f. the pragmatic
> approach taken by XML.
> 
> > Oh well, the longer this discussion takes, the more I 
> regret my decision
> > to revert sed to textmode.
> 
> This means my argumentation has been counter-productive. :(
> 
> Note, I realize how entrenched the opposite point of view 
> seems to be in
> this community and I don't have any illusions of quickly converting
> everybody. By sticking to arguments instead of emotions I was 
> trying to
> avoid this very reaction of yours. My goal is to plant a 
> thought in the
> back of people's minds so that perhaps gradually they might begin to
> appreciate my point of view and take it into account a little 
> bit when 
> similar calls need to be made again about one detail or another.
> 
> Thanks for reading,
> 
> Joachim
> 
> -- 
> work:     joachima@netacquire.com   (http://www.netacquire.com)
> private:  joachim@kraut.ca          (http://www.kraut.ca)
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
> 
> 

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]