File Formats?!

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

User avatar
CWBillow
Posts: 105
Joined: Thu Nov 06, 2003 11:59 pm
Location: Chula Vista California
Contact:

File Formats?!

Post by CWBillow »

Somebody?!

I started using Acronis's Disk Director, part of which is the Operating System Selector.

I was having a lelluva time getitng the boot.ini files to work right. They were showing as ANSI files when I edited them.

After spending most of the day trying to resolve this, I, on a lark, opened up the file in UltraEdit.

Before opening, it asked my if I wanted to convert the file to DOS. I fgigured worth a try, and said yes.

After saving the file, it worked.

I went back to the un-nodified file, and called it up again in UE, and looked again:

It was showing as UNIX format.

Why would UltraEdit see this as a UNIX file, and TextPad see it as ANSI?

I'm WAY too much a newbie here:

Why did this happen, and what the heck is thye difference? And why did one work and not the other?

Regards,
Chuck Billow
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

You're confusing line endings with character sets. The line endings (for example, DOS (PC) or Unix) a file has is independent of the character set (for example, ASCII or Unicode) it's using.

It seems that your file was created with Unix line endings (line feed (LF)) instead of PC line endings (line feed, carriage return (CR LF)). You can check with
View | Document Properties | Document | File type.
And it seems that whatever is reading your boot.ini file can't cope with Unix line endings (as a result of poor and lazy programming).

If this is indeed the problem, the solution is simply to save the file in PC format:
File | Save As... | File format: PC.

When you open the file subsequently, TextPad will preserve the PC line endings.
User avatar
CWBillow
Posts: 105
Joined: Thu Nov 06, 2003 11:59 pm
Location: Chula Vista California
Contact:

Post by CWBillow »

Got it.

Thanks Ben.

Regards,
Chuck
User avatar
CWBillow
Posts: 105
Joined: Thu Nov 06, 2003 11:59 pm
Location: Chula Vista California
Contact:

Post by CWBillow »

Ben:

What's the diff between DOS and ANSI formats?

Chuck
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

In this context DOS format refers to line endings; ANSI refers to character sets.

A file in DOS format has CR,LF line endings.

ANSI is not a format. It is an incorrect term that vaguely refers to a number of 8-bit character sets, such as Windows CP 1252, ISO 8859-1 (Latin 1) and ISO 8859-n (for a variety of other values of n).

See http://www.textpad.info/forum/viewtopic.php?t=6111.
User avatar
CWBillow
Posts: 105
Joined: Thu Nov 06, 2003 11:59 pm
Location: Chula Vista California
Contact:

Post by CWBillow »

ben_josephs wrote:In this context DOS format refers to line endings; ANSI refers to character sets.

A file in DOS format has CR,LF line endings.

ANSI is not a format. It is an incorrect term that vaguely refers to a number of 8-bit character sets, such as Windows CP 1252, ISO 8859-1 (Latin 1) and ISO 8859-n (for a variety of other values of n).

See http://www.textpad.info/forum/viewtopic.php?t=6111.
Yea, my error... both DOS and ANSI are both showing i the "Encoding" box...

Still doesn't splain it for me... but I'll go look at you link...

Thanks,
Chuck
User avatar
CWBillow
Posts: 105
Joined: Thu Nov 06, 2003 11:59 pm
Location: Chula Vista California
Contact:

Post by CWBillow »

ben_josephs wrote:In this context DOS format refers to line endings; ANSI refers to character sets.

A file in DOS format has CR,LF line endings.

ANSI is not a format. It is an incorrect term that vaguely refers to a number of 8-bit character sets, such as Windows CP 1252, ISO 8859-1 (Latin 1) and ISO 8859-n (for a variety of other values of n).

See http://www.textpad.info/forum/viewtopic.php?t=6111.
So when in Textpad the "Encoding" choice says "ANSI or DOS as two of the choices, what is actually referred to there is ASCII or ANSI?

CB
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Ah. The term DOS there would refer to the old OEM character set--the 8-bit character set with line- and box-drawing characters instead of many letters with diacritics.

Confusing, ain't it, especially when the wrong terms are used!
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

If you're using the default Western "script", ANSI means Windows CP 1252.
User avatar
CWBillow
Posts: 105
Joined: Thu Nov 06, 2003 11:59 pm
Location: Chula Vista California
Contact:

Post by CWBillow »

ben_josephs wrote:If you're using the default Western "script", ANSI means Windows CP 1252.
So then I'd use ANSI and be OK?

CB
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Does your boot.ini contain any characters whose values are in the range 128..255, such as letters with diacritics, pound sterling signs, euro signs, copyright signs, etc? If not then it won't make any difference whether you save in "ANSI" or "DOS" encoding.

The important thing here is the line endings ("file format"). Use "PC".
User avatar
CWBillow
Posts: 105
Joined: Thu Nov 06, 2003 11:59 pm
Location: Chula Vista California
Contact:

Post by CWBillow »

ben_josephs wrote:Does your boot.ini contain any characters whose values are in the range 128..255, such as letters with diacritics, pound sterling signs, euro signs, copyright signs, etc? If not then it won't make any difference whether you save in "ANSI" or "DOS" encoding.

The important thing here is the line endings ("file format"). Use "PC".
No special characters... straight text. And I don't have the foggiest why Acronis' boot.ini file in Disk Director shows up as UNIX. I se no reason whatever, as the file is pure, straight text instructions.

Their support even tells you to edit in Notepad to be sure to end up with pure text.

So why the UNIX? Textpad and UltraEdit and Wordpad all saw the files I opened as UNIX.

Caused me all kinds of grief till I realized what the heck was happening.

Regards,
Chuck Billow
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Do you mean that your problem is solved?

Your file is a "pure text" file. That's not the issue. It's "pure text" regardless of whether it contains é or ø or £ or € or § or ¿ or © or whatever, and whether it has Unix or PC line endings.

It seems that you just got the wrong line endings in it.

Did you create the file from scratch? If so, do you have a document class for .ini files? If so, what is the setting in
Configure | Preferences | Document Classes | <Class> | Create new file as
?
If you created the file from scratch and you do not have a document class for .ini files, what is the setting in
Configure | Preferences | Document Classes | Default | Create new file as
?

If you didn't create the file from scratch, presumably the original had Unix line endings. Where did it come from?
User avatar
CWBillow
Posts: 105
Joined: Thu Nov 06, 2003 11:59 pm
Location: Chula Vista California
Contact:

Post by CWBillow »

ben_josephs wrote:Do you mean that your problem is solved?

Your file is a "pure text" file. That's not the issue. It's "pure text" regardless of whether it contains é or ø or £ or € or § or ¿ or © or whatever, and whether it has Unix or PC line endings.

It seems that you just got the wrong line endings in it.

Did you create the file from scratch? If so, do you have a document class for .ini files? If so, what is the setting in
Configure | Preferences | Document Classes | <Class> | Create new file as
?
If you created the file from scratch and you do not have a document class for .ini files, what is the setting in
Configure | Preferences | Document Classes | Default | Create new file as
?

If you didn't create the file from scratch, presumably the original had Unix line endings. Where did it come from?
Ben:

My problem is solved as far as getting out of this jam, but not entirely as far as knowing what the heck happened in the first place.

The file(s) came from Acronis.com, in their OS Selector. The key files (*.OSS and *.ini) are *supposed* to be pure text, and, I had presumed, DOS format.

They ended up being UNIX when read, and yet were fine when saved as pure text with CR/LF line endings (like in notepad).

II've got (kinda) what went wrong; I don't I guess understand how it could or would have in the first place:

Why would the files have been in UNIX format to begin with, if they were intended for a PC market base? That answer would maybe help me understand what or why UNIX would do what "typical" formats couldn't.

Regards,
Chuck Billow
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Have you asked Acronis?
Post Reply