-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
This is almost a feature request, but I came down on the side of a UI bug...
The browser provides a "binary" view of blob data that is handy for humans.
Sometimes it's useful to extract the blob as binary for analysis (or formatting) by external tools.
The Export button in the "Edit Database Cell" pane is of two minds on this -- maybe more.
On one hand, it displays a text hexdump - which is handy for humans.
But Export provides a filename of ".txt", so one expects a human-readable form to be written.
Then again, the output isn't the text dump, but appears to be the raw data. I haven't tried a complex test case, but hopefully the output is written in binary ("wb") mode. (I encountered this with a record that has a a few bare ^M s - which seems to be enough for you to decide it's a blob.)
The following observations seem apropos:
- when exporting a blob, the data should be written in binary mode
- The filename should not be associated with a text file -- .bin or .dat would be more appropriate
- It should be clear that what is exported is the data, not the hex dump that one sees
- It might be nice to have a choice between exporting the hex dump (as a text file) and the raw binary (suitably identified). Of course, given the binary, other tools can re-create a dump. But as you have one, might as well allow exporting it... Might be a use for the "Autoformat" button when viewing a blob.
- The message binary data can't be viewed with the text editor is misleading; it can be viewed if you switch to "binary mode". The message should be something like binary data can't be viewed in this mode. Try selecting Binary mode.
As long as you're providing a hex dump, it would also be helpful to be able to select formatting as (16-bit, 32-bit or 64-bit) words. Saves manually grouping and flipping bytes on a little-endian machine.
Hope this is useful.