-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editing BLOB as Text truncates value at first NULL byte #19
Comments
Make the EditDialog a bit more user friendly when editing binary data in text mode: Don't change back to the hex editor after changing any character. Show the full binary data even if it contains a NULL byte. Also (though a bit unrelated) disable rich text input for the text widget. This partially fixes issue #19.
This is a difficult one because of Qt doing much UTF-8 converting automatically. What I could do is showing the full data in the text editor and keeping the dialog away from changing back to the hex editor all the time. |
Yes, it seems to be a very difficult area. Full function UTF8-aware hex/text editors seem very few and far between. |
Thanks for the hint - commit 41296e3 incereases the size of that dialog to fit the entire hex editor widget (at least on my system, that is). I think these changes make the dialog a lot more user friendly but I'd still like to keep Qt away from inserting replacement characters. We'll have to see if that's even possible though 😒 Still, looking forward to your feedback on the new version tomorrow 😄 |
@MKleusberg both commits appear to have achieved what was intended - looks good, thanks!
Seeing where there is a null means I'm less likely to remove it by mistake. |
As a side thought, is there a difference in the way Qt4 vs Qt5 do this? At the moment we can compile against either, but if Qt5 is better then we could potentially move to Qt5 specific? |
@stevehodgett We've made a huge amount of changes and bug fixes since this was reported, including many in our unicode handling. Would you have a few moments to try our new release (3.8.0) and make sure it's working properly now for you? 😄 |
Closing this as it's almost been a year without updates. Chances are that the copy-paste situation improved when we moved to Qt5 but either way: there isn't much we can do about it on our side. Adding an edit option to the right side of the hex editor turns out to be difficult, too. We would have improve the QHexEdit widget but that's an external project by different people. The "caf.." problem isn't actually a bug but correct this way: the "é" is encoded using two separate bytes and none of them represents the "é" on its own, thus the two dots. And finally, you can now set the font for the edit dialog, choosing one which doesn't omit NULL bytes but prints a box or something instead. This way "testtest" should become ~~ "test[]test". |
It's been almost three years, so this is probably just for the records, but: Good news! I've just updated the QHexEdit library in our repository and editing the ASCII code on the right side of the hex editor is now finally supported 😉 |
@MKleusberg That's awesome. 😄 |
This is more a comment than a bug report, but I noticed this when testing the fix for issue #16.
Suppose you have a BLOB containing multiple null-terminated strings. When you edit the blob, everything is fine as type:Binary, but if you change the type to "Text" in the EditDialog the length of the data remains the same but only the data up to the first null is shown (understandable, but not what the user might expect). Switching back to type:Binary shows all the data again.
However, if you change the data in the type:Text view it is immediately truncated at the first null (the new length shown at the bottom of the EditDialog window), and switching back to type:Binary only shows the truncated data.
I do think it's a valuable facility to be able to edit text within a blob - editing UTF-8 encoded text in hex mode is only fun once :-)
The text was updated successfully, but these errors were encountered: