elfmz / far2l

Linux port of FAR v2
GNU General Public License v2.0
1.78k stars 173 forks source link

Text with BOM marks is shown incorrectly in viewer and editor #850

Open e673 opened 3 years ago

e673 commented 3 years ago

When BOM mark appears in the middle of the text (i.e. in log files), an extra space is added after the next word when using 65001 encoding. For example, file [61 EF BB BF 62 20 63] should be presented as:

ab c

but

ab  c

is observed: far_bug

When trying to edit such file, a mess with characters appearing in wrong place happens around this place.

bug.zip

elfmz commented 3 years ago

BOM in the middle of text. is it legal at all?

e673 commented 3 years ago

Yes, it is not punishable for files to contain any sequence of bytes. For example, in appears in RFC 5424 - every message follows after text header and is prefixed with BOM mark. So viewing log file is buggy.

unxed commented 6 months ago

Not reproduced for me in master. Check now, please!