Windows Arduino-0013 Libraries Do Not Have CR/LF

In the Microsoft Windows versions of Arduino-0013, I notice that the individual hardware\libraries modules do not seem to have DOS-style carriage returns and linefeeds embedded in each line. This means opening, for example, SoftwareSerial.cpp in Microsoft Windows Notepad gives you a jumbled mush of code, even with word wrap turned on. To fix this, someone (somewhere) needs to run the text files through the unix2dos utility. One gets the impression that the official library source code was created on a Unix system.

Thanks

Bob

try wordpad instead of notepad, works fine for me.

Yes, I use right click, open with, wordpad.

Lefty

I agree, you need to use a better text editor or programming editor. I always used to use pfe32 but its getting old now.

Gordon

Thanks for all your replies. I’m talking about the actual input format of each line of the library source code. The Microsoft Windows versions of the source files should be terminated with Microsoft style linefeeds and carriage returns. The Unix/Linux version should be terminated with Unix line feeds. The Mac OS version should be terminated with whatever characters that text format requires – probably line feeds.

I should be able to open any of these source files with any text editor (and this would include the Netbeans or Eclipse editors) and I should get a clean readable page of text immediately.

Thanks

Bob

I'm talking about the actual input format of each line of the library source code. The Microsoft Windows versions of the source files should be terminated with Microsoft style linefeeds and carriage returns. The Unix/Linux version should be terminated with Unix line feeds. The Mac OS version should be terminated with whatever characters that text format requires -- probably line feeds.

That would sort of defeat the notion of a common set of source files. Linux and OSX don't have any problems with the source files. So why should there be a unique version of the source just to fix a Windows Notepad issue?

You do not want to force the end user to have to resort to editing the library source code for the sole purpose of being able to read it alone. That can lead to unintended corruption of the code. Seeing this sort of thing (no data conversion between platforms) is a sign of haste among the "official" developers, or perhaps just an oversight. It should not have happened, but it did. It is an industry standard to convert between formats and has been for as long as computers have been around. The 'unix2dos' and 'dos2unix' utilities are standard on most Unix distributions and there are quite a few other conversion utilities too. There are conversion utilities for Microsoft Windows which prepare text for export to Unix systems and other systems. Until a couple years ago I was a programmer on IBM mainframes and we have to convert between 7-bit ASCII and EBCDIC and Microsoft Windows formats. If you provide executables and source code for a given OS platform, then you need to do a complete and thorough job of it and make sure all the elements are compatible to the target platform. Since source code libraries are provided, a Windows version of Arduino-0013 should have source code files which are correctly formatted for Microsoft platforms and not just dll and exe files that execute.

Thanks

Bob

Well since it's a free, open-source project where all contributors provide their time without compensation, feel free to participate and take responsibility for converting the source files to cr/lf format for the Windows distribution since you're so concerned about it.

The dos2unix and unix2dos tools (and many other *nix tools) are available in Windows through the Cygwin project.

http://cygwin.org/

Personaly, I dont see a problem here. Its just a matter of using the correct application/editor for the files. If I want to look at a file thats in a particular format I use an editor or viewer that can handle that format.

The user doesnt have to edit the source files to be able to view them. All they have to do is use the correct application to work with them.

Notepad seems very rigid in the text format it can handle. Its not meant to be a programming tool. Theres plenty of alternatives to use.

Changing the files like this so windows users can use notepad seems a bit extreme and could lead to inconsistencies. Theres the overhead of maintaining the differences and the additional testing to make sure no typos or mistakes creep in.