cr, lf, and reading in terminals/vim

Bob Sneidar bobsneidar at iotecdigital.com
Thu Oct 31 12:31:30 EDT 2019


I gave the wrong impression. I was saying that other apps and it perhaps the OS X system itself takes liberties with conversion of line endings. For instance, Mocrosoft Word and Excel. I would expect I could open a file to look at it, close it without saving, and absolutely nothing would change. But it does. 

I know this because I tested it with one of the aforementioned Address Book Export files. I exported the file, then imported it without opening it in any MacOS app. Worked fine. Opened the file in Word, closed without saving, copier refused to import the file. 

That sort of thing is what I meant was reprehensible. Developers should not be taking those liberties. 

Bob S


> On Oct 31, 2019, at 09:24 , Richard Gaskin via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Bob Sneidar  wrote:
> > Upon examining the ascii value of every line terminator I discovered
> > something, perhaps the OS or the software itself, converted the
> > terminators to something else. I also find this practice to be not
> > just confusing, but reprehensible.
> 
> LC supports two write modes: text and binary.  Perhaps the editor you'd used supports the equivalent of LC's text mode, where the data is indeed altered to provide greater convenience for cross-platform line-endings, replacing NULLs with spaces, etc.  This is consistent with how HyperTalk established writes, and I've seen some text editor packages do similar things.
> 
> When you need to preserve data as-is, use binary mode.
> 
> Thankfully LC provides both.  HyperCard provided only text mode, and SuperCard only binary mode.  I like being able to use each depending on what I'm doing.





More information about the use-livecode mailing list