Page 1 of 1

Missing char after Carriage Return in .txt preview

Posted: Sun Aug 12, 2007 9:31 am
by Hamish
When there is a .txt file as an attachment, UE displays the file in grey. However some files are displayed with missing characters at the beginning of the line.

Looking at the hex of the file, it appears that the file contains Carriage Returns only, not followed by Line Feed. So what is happening is that UE is reading a CR then expecting a LF. So it sucks in the next character and throws it away.

For example "ABCDEFcrIJKLcrcrMNOPcrQRSTUV" comes out as

ABCDEF
JKL
MNOP
RSTUV

I realise the format of the original file is wrong, but it would be nice if UE tried its best to ignore that.

Posted: Sun Aug 12, 2007 9:46 am
by alex
actually it is then an invalid text file format. as to usenet formats <CR> <LF> is enforced, as to attachments (show inline) UE just shows something, but basically it shows both windows and unix text files well.

for windows files the standard it <CR> <LF> and for unix files <LF>.

there is no such thing as <CR> alone.

in this particular case i could check it, just weird, give me here or pm the coordinates of the attachment, normally you don't see such files at all. if you open such a file in notepad you see [] like character instead of <CR>, UltraEdit unless you "convert file to dos format" gets puzzled and puts a lot of ? characters in the beginning of every line following the <CR> character (I changed one <CR><LN> to <CR><CR> in a text file).

Posted: Sun Aug 12, 2007 10:21 am
by alex
ok i posted an example myself, but i guess it is not so urgent to make a release right now :)

Thanks

Posted: Sun Aug 12, 2007 2:44 pm
by Hamish
Cheers Alex - no it is not important and the problem lies with the poster of the file.

I don't know if it is significant but here is a header line from one poster of a "bad" text file:
X-Newsposter: YENC-POWER-POST Build 3 (Modified POWER-POST www.CosmicWolf.com)

Posted: Sun Aug 12, 2007 11:26 pm
by alex
no it depends on the program which created the file, if it is not poster so it is not poster to blame, if it is some autogenerated file the programmer just put there wrongly only \r (CR) instead of \r\n (CR LN) or \n (LN).