Ticket #224 (accepted defect)

Opened 19 months ago

Last modified 10 months 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

Changed 19 months 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!

Changed 19 months ago by jquelin

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

Changed 16 months 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

Changed 10 months ago by azawawi

Any update on this one?

Changed 10 months 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.

Note: See TracTickets for help on using tickets.