Problem
Viewer mode interpretes any 0x00 byte in the file to be viewed as a C "end of string" symbol, resulting in premature termination of the rendering. This means that in binary files and in many cases, you'll just see a few characters before a spurious 0x00 is encountered.
Solution
Replace any 0x00 (except the last one) with 0x20 (space) before passing the file's content on to the view method. There is no degradation in the user experience because they would not get to see these 0x00 bytes anyway as they result in the termination of the view's rendering.
I noticed this as part of working on #320 and would be happy to implement it if you find it useful.
Problem Viewer mode interpretes any 0x00 byte in the file to be viewed as a C "end of string" symbol, resulting in premature termination of the rendering. This means that in binary files and in many cases, you'll just see a few characters before a spurious 0x00 is encountered.
Solution Replace any 0x00 (except the last one) with 0x20 (space) before passing the file's content on to the view method. There is no degradation in the user experience because they would not get to see these 0x00 bytes anyway as they result in the termination of the view's rendering.
I noticed this as part of working on #320 and would be happy to implement it if you find it useful.