Short answer:nubc wrote:I forgot to ask: What happens if I try to open a geany file in Windows XP?
It will open, and probably look fine if using a fairly recent text editor.
Medium answer:
The reason I say "probably" in the short answer above is that the MS-DOS/Windows world and the Unix/Linux world have differing preferences when it comes to the control characters used to represent the end of a line of text. Years ago this was a bit of a headache. But modern text editors usually accept either preference.
As an experiment, I booted up an old PC that still had Windows 98 on one partition. Notepad refused to deal with the Linux NL (New Line) characters, represented them as black rectangles, and printed each line at the end of the previous line. But WordPad displayed the Linux files fine. And loading the file with WordPad and saving it created a file that Notepad could display.
Long answer:
The files that geany creates are simply text files, and can usually be displayed in any text editor because they use standard encodings (such as ASCII, ISO-8859-1, and UTF-8 ) and have no special formatting codes like, for instance, word processor documents or spreadsheets.
I say "usually" only because geany supports a lot if encodings, so it is possible to save a geany file with an encoding that isn't supported by every text editor. But if you stick with common encodings like UTF-8, or ISO-8859-1 (the default used for geany in the Puppies I've seen) you should be able to use any modern text editor.
The one fly in the ointment is that different operating systems prefer different control characters to signify the end of a line of text. How can that be? Didn't I just say that text files use "standard encodings"?
Yes. Well, we live in an imperfect world, and standards are not always as standard as we would hope them to be.
These standards are based on standards that were developed fifty years ago when Teletype machines roamed the earth. Teletypes normally used a pair of control characters to end a line: CR (Carriage Return) and LF (Line Feed). As the names suggest, the first returned the print head to the first character position in the line, and the second advanced the paper by one line.
Some folks thought that it was inefficient to send two control characters for each line when a machine could be designed to both move the print head and advance the paper in response to a single control character. So they lobbied for the inclusion of a NL (New Line) control character in the ASCII standard to allow for that behavior.
But ASCII was only a seven-bit encoding, which limited it to 128 possible elements, all of which were already in use. So it was decided to use the value that represented LF to also represent NL.
Wait. How can one value represent two different control characters? It can't. Users of ASCII had to agree amongst themselves which control character to use. And so the standard became less of a standard.
So two data terminal operators could agree to use CR/LF or they could agree to use NL, assuming that they had machines that allowed them the option to choose. More likely, a corporation with a data network would buy equipment that all supported one convention or the other. Either way, everyone was happy.ASCII 1968 wrote:LF (Line Feed): A format effector which controls the movement of the printing position to the next printing line. (Applicable also to display devices.) Where appropriate, this character may have the meaning "New Line" (NL), a format effector which controls the movement of the printing point to the first printing position on the next printing line. Use of this convention requires agreement between sender and recipient of data.
But ASCII was originally developed for communication. When used for encoding files, the concept of "this convention requires agreement between sender and recipient of data" is hard to enforce. When was the last time you sat down with the people who created the text files on your PC and discussed what convention you should use?
Since it is not practical to have millions of text file creators discussing which convention to use with millions of text file users, the decision ended up being made by the folks developing operating systems, since system software was usually initially designed to support just one convention.
Of course, the folks developing one operating system might not choose the same convention as those developing another operating system. But it didn't matter at the time, since back then it was rare for a file written on one O.S. to be used on another O.S., unlike today.
Anyway, the Unix world settled on the NL convention, and the MS-DOS/Windows world settled on the CR/LF convention.
Using the value for NL with hardware or software that expects that value to represent LF would, years ago, cause the same behavior that would happen when a LF control character was sent to a Teletype machine: the paper (or the cursor on a CRT display) would advance to the next line, but the print head (or cursor) would not return to the first position in the line.
So this gave a sort of "stair-stepping" output, where the first line would start on the left, but each subsequent line would start under the end of the previous line. Using the MS-DOS commands TYPE and MORE on my old Windows 98 machine showed this kind of output for a file that used NL characters.
How to convert, if necessary:
Although Windows WordPad and probably many other editors should handle text files from geany that use the default NL convention, you can manually convert the files to use the CR/LF convention with this command:
Code: Select all
unix2dos test.txt
Document -> Set Line Endings -> Convert and Set to CR/LF (Win)
But, again, there is probably no need to do this. Chances are good that a modern text editor in Windows will open the files fine without you needing to do anything special.