Ticket #224 (closed defect: fixed)

Opened 5 years ago

Last modified 2 years ago

padre chokes on files containing NULL byte (^@)

Reported by: jquelin Owned by: jquelin
Priority: major Milestone:
Component: editor Version: 0.25
Keywords: Cc:

Description

  1. download mycology at http://users.tkk.fi/~mniemenm/files/befunge/mycology/mycology.zip
  2. unzip it
  3. open mycology/mycology.b98 with padre

==> it takes a looooong time to load, and is rendered as utf8 crap

note:
a) this file is in dos mode. however, converting it to unix with:
$ perl -pi -e 's/\r\n/\n/g' mycology.b98
doesn't change the problem.
b) other files from this archive open nicely
c) it also happens when opening mycology.b98 from an opened padre

Change History

comment:1 Changed 5 years ago by jquelin

  • Summary changed from padre chokes on file / renders it as utf8 crap to padre chokes on files containing NULL byte (^@)

ok, i managed to trim the test case: it happens if you have a null byte within the file. eg, create a file containing:

foo@bar

@ is ctrl+v ctrl+0 in vim, and ctrl+q in emacs (not sure about emacs, it's been too long! :-) )

and look how padre renders it awfully bad!

comment:2 Changed 5 years ago by jquelin

oops, trac messed up the test case: @ should be read as "caret at", or ctrl+0, or null byte.

comment:3 Changed 5 years ago by jquelin

  • Owner set to jquelin
  • Status changed from new to accepted

it is a bug in encode::guess, reported upstream
cf https://rt.cpan.org/Ticket/Display.html?id=44523

comment:4 Changed 5 years ago by azawawi

Any update on this one?

comment:5 Changed 5 years ago by jquelin

unfortunately, upstream considers this is not a bug.
since encode does best guess, and it finds an encoding in which the data is valid, it chooses this encoding...

so i don't know exactly what's the best way to handle this bug.

comment:6 Changed 2 years ago by bowtie

  • Status changed from accepted to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.