PDA

View Full Version : Notepad displays garbage; Wordpad works fine.


Ryan Westafer
December 5th 03, 07:26 AM
Every now and again a data collection application
generates a file that Notepad simply cannot display.
However Wordpad, command-line edit.exe, vi on UNIX, etc.
will open the file just fine.

Is this a bug in notepad?
(The result was verified on multiple XP Professional
machines)

You may find a sample file at the following address:

http://www.ihmc.us/NotepadFails.txt.zip
(it is simply a zipped text file)

-Ryan

toddkozi
December 5th 03, 07:31 AM
It is odd. In ME it opened in Notepad, but in XP *something* opened in=20=

Notepad.=20

It seems that something isn't proper at the beginning (of one or the=20=

other). If you put a space at beginning in wordpad then it will open in =

Notepad. Take the space away in notepad and then reopen it and it's=20
garbled again.=20

I don't know how text is output properly, so I don't know if it's a bug =

in Notepad or the output. Since Notepad can't reopen it once the leading=
=20
space is deleted, I'm guessing a flaw in Notepad (because I would think =

Notepad would save in proper format). If you have another version of=20=

notepad, you can use that. I just tried the ME notepad.exe in XP and the=
=20
data opened fine.
-
Todd=20
PS That's a heck of a website where you posted that zip!=20
Augmented Cognition! I could use some of that.

>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 7/31/2003, 2:32:02 PM, "Ryan Westafer" > wrote =

regarding Notepad displays garbage; Wordpad works fine.:


> Every now and again a data collection application
> generates a file that Notepad simply cannot display.
> However Wordpad, command-line edit.exe, vi on UNIX, etc.
> will open the file just fine.

> Is this a bug in notepad?
> (The result was verified on multiple XP Professional
> machines)

> You may find a sample file at the following address:

> http://www.ihmc.us/NotepadFails.txt.zip
> (it is simply a zipped text file)

> -Ryan

toddkozi
December 5th 03, 07:31 AM
By hex editing the text file, I've seen that by appending a space to the=
=20
initial "TS" making "TS " seems to eliminate notepad's confusion.

Also even numbers of characters appended to "TS" make the garbled notepa=
d=20
result, and odd numbers of characters do not. It seems that if this is=20=

commonly occurring then perhaps noticing whether the initial string is a=
n=20
even number of characters and appending a space to this initial string=20=

may solve the problem. I've seen this only by working on the text file=20=

you've sent. I haven't been able to independently create a file that=20=

causes this notepad error.

Just resaving in notepad cause notepad to prepend 0xFFFE to the file.=20=

That seems to indicate that notepad doesn't like something about the=20=

file, but what that is I haven't found yet.
-
Todd

> On 7/31/2003, 2:32:02 PM, "Ryan Westafer" > wrot=
e
> regarding Notepad displays garbage; Wordpad works fine.:


> > Every now and again a data collection application
> > generates a file that Notepad simply cannot display.
> > However Wordpad, command-line edit.exe, vi on UNIX, etc.
> > will open the file just fine.

> > Is this a bug in notepad?
> > (The result was verified on multiple XP Professional
> > machines)

> > You may find a sample file at the following address:

> > http://www.ihmc.us/NotepadFails.txt.zip
> > (it is simply a zipped text file)

> > -Ryan

Google