Problem saving with gEdit and then viewing with Notepad

Status
Not open for further replies.

VicRic

Posts: 37   +0
Hi. I'm using gEdit in both Fedora 6 and SUSE 10. I mostly use it to paste interesting text that I cut from web pages and then saving the text into a file.

The problem is that when I save the text into a file I get the following default option:

https://www.techspot.com/gallery/data/500/medium/geditsave.png

if I accept that and save and then move the file to a Windows machine and open it with Notepad then the text does not look as it should - you'd see all the text in one line, and the line breaks as the 'blank square' special character.

Any idea on how can I solve this? I notice that Notepad saves its text into ANSI encoding, and gEdit only gives me options to save it in 'Current Locale UTF-8', 'Western ISO 8859-1', 'Western ISO 8859-15'. I don't see the option in gEdit to save the file in ANSI encoding, and I cannot 'Add' it.

BRgds
 
Yeah, I know what this is.

Basic ASCII-only text files use a special control character to mark the beginning of a newline, '\n' is the newline character. That program gEdit (I'm not familiar with it) isn't using that character to separate the lines, instead uses some other character code. That's why when you open it in Notepad, it displays it all on one line.

You are correct, the file type encoding must match between text programs or else the text will appear messed up.
 
Hey Al, I got advice on how to fix it.

Using WordPad does solve the problem: you open the 'unix' file with WordPad and it's already readable. If you want to keep a converted copy then select in WordPad to save the file as type TextDocument-MSDOSFormat.

Unix2dos also works; too bad it's a Terminal utility in Linux.
I use it like this:
$ unix2dos -n inputfile outputfile.txt
and then move the file outputfile.txt to the Windows machine.

BRgds
 
Yeah, I know unix2dos (or u2d) I used to be a high tech engineer. All that utility does is exactly what I explained above. It adds/removes the newline character, '\n'. That's all!
 
Status
Not open for further replies.
Back