Comments (11)
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.
However, once you change a BLOB which contains a non-UTF-8 character it is replaced by the UTF-8 replacement character (EF BF BD) and thus rendered useless... This happens somewhere in QTextEdit or QTextDocument. NULL characters work though :)
from sqlitebrowser.
Yes, it seems to be a very difficult area. Full function UTF8-aware hex/text editors seem very few and far between.
Perhaps it would be reasonable to settle for disabling Text editing for blobs :-(
By the way, I only discovered by accident that the binary edit mode has the text displayed on the right hand side - it's completely hidden when the EditDialog opens at its default size!
Maybe make the default width enough to show the 16 bytes in both hex and text?
from sqlitebrowser.
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).
In commit ae4d04f I've also added a warning which appears when the user attempts to change binary data in text mode.
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 😄
from sqlitebrowser.
@MKleusberg both commits appear to have achieved what was intended - looks good, thanks!
May I make a couple more (final?) comments? (although I understand you may have better things to do than attend to this level of detail)
- there is no visible representation of a null byte in the text view, and
2."Select all" highlights all the text, but "copy" only copies up to the first null
Seeing where there is a null means I'm less likely to remove it by mistake.
Being able to copy the entire blob value at least gives me the opportunity to take the data for processing elsewhere (and a really nice feature of the EditDialog is that I can get my binary data back into sqlitebrowser by pasting it as hex pairs).
from sqlitebrowser.
Don't worry, I do care about this level of detail and all input is welcome :)
- This might be because of your font or so. I get at least some sort of representation on my system and if you don't have a similar result on yours we might be able to fix it.
- Hmm, I can reproduce this. The problem here is that this bug lies somewhere in the Qt code. While it's possible to rewrite that code inside the application I'm not sure if it's worth the effort to be honest. I think the better approach might be to make editing binary data as comfortable as possible without usage of the text editor. If you haven't noticed them you might want to try the Export and Import buttons. And I'll check if it's feasible to extend the hex editor widget to allow input on the right side where the text representation is. I'd also be interested in any other suggestions!
from sqlitebrowser.
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?
from sqlitebrowser.
Here's what I see on Windows 8.1:
To my mind, the best solution is, as you suggest, to extend the hex editor widget if possible to allow input on the right side.
By the way, the hex editor doesn't appear to make any attempt to display multi-byte UTF-8 characters ("café" will appear as "caf.."). Another Qt constraint?
from sqlitebrowser.
@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? 😄
from sqlitebrowser.
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".
from sqlitebrowser.
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 😉
from sqlitebrowser.
@MKleusberg That's awesome. 😄
from sqlitebrowser.
Related Issues (20)
- [Feature]: Save plot as SVG
- Error in error log; (21) API called with NULL prepared statement HOT 2
- [Bug]: Changing the display format of a column destroys its sort order HOT 2
- [Bug]: Pin To Taskbar Windows10
- [Bug]: Some UI text don't scale according to font size settings. HOT 3
- [Bug]: Exact filter on COUNT() column doesn't work HOT 10
- [Bug]: Assertion [cpMax <= pdoc->Length()] failed at ../scintilla/src/Editor.cpp 6096 HOT 3
- [Feature]: Fix ordering of schema export HOT 3
- [Bug]: creation of new db file upon attach of non-existing file fails. HOT 2
- [Feature]: "Filter in any column" should only filter in '__rowid__' is visible HOT 3
- Add Debug Information to 'Continuous' Release HOT 2
- Check Update for Unstable Build HOT 1
- Port to Qt 6 HOT 1
- Rewrite Build Entries in the Wiki HOT 1
- Support for Branch-Specific Build Variants HOT 1
- [Bug]: Importing CSV with column headers doesn't work if columns are not in same order as table in DB HOT 1
- Quick Browse HOT 1
- [Feature]: Comment Line Shortcut key for "Execute SQL" tab and Shortcut Key selection screen HOT 3
- [Feature]: auto reopen last database HOT 7
- No data returned from SQL query HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sqlitebrowser.