tarot231 / leafpad

GTK+ based simple text editor
GNU General Public License v2.0
44 stars 14 forks source link

Leafpad stops rendering characters once null character is encountered #19

Open relma2 opened 3 months ago

relma2 commented 3 months ago

Here I have a log file that contains data written to a unix pipe:

bridge.log

Leafpad renders up until "Wrote 49 bytes to unix pipe" and then stops rendering because it encounters a character that is an unrenderable hexadecimal value, the null character. Viewing the file on vim correctly renders the null character as ^@, the caret notation for the null character, and continues rendering the rest of the characters in the file.

Please render the null character as a box with "\00" inside, and continue rendering the rest of the file even with this character encountered.

tarot231 commented 2 months ago

The GTK (GLib) function is used to read the file, and the null character handling depends on it. https://docs.gtk.org/glib/func.file_get_contents.html