Ticket #3260 (closed defect: fixed)
mcview hex edit: can't enter certain UTF-8 characters
Reported by: | egmont | Owned by: | andrew_b |
---|---|---|---|
Priority: | minor | Milestone: | 4.8.14 |
Component: | mcview | Version: | master |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Branch state: | merged | Votes for changeset: | committed-master |
Description
mcview, hex edit mode, in a fully UTF-8 environment.
Certain UTF-8 characters (e.g. á é í ó) can properly be entered, they overwrite two bytes.
Certain other UTF-8 characters (e.g. ő Á É Í Ó) only overwrite one byte, the second byte is swallowed.
Attachments
Change History
comment:2 Changed 10 years ago by egmont
Patch updated. The TAB key shouldn't be accepted as literal, to allow moving back to the hexview area.
comment:3 Changed 10 years ago by egmont
Friendly ping... a patch has been attached for 6 months now. Could you please take a look? It would be nice to release this fix along with the mcviewer rewrite.
comment:4 Changed 10 years ago by andrew_b
- Owner set to andrew_b
- Status changed from new to accepted
- Branch state changed from no branch to on review
- Milestone changed from Future Releases to 4.8.14
Thanks!
Branch: 3260_hexedit_utf8_input
changeset:f0ab29b82063ff130e434fb0b889d95db229a9dd
comment:5 Changed 10 years ago by andrew_b
- Votes for changeset set to andrew_b
- Branch state changed from on review to approved
comment:6 Changed 10 years ago by andrew_b
- Status changed from accepted to testing
- Votes for changeset changed from andrew_b to committed-master
- Resolution set to fixed
- Branch state changed from approved to merged
Merged to master: [f0ab29b82063ff130e434fb0b889d95db229a9dd].
Fix attached.
An is_printable() check was performed for every byte of the UTF-8 which obviously doesn't make sense. This check shouldn't be performed for 8-bit charsets either. If the given byte can arrive as input, the file should be modified accordingly. Updating the display should be another story, taking care of replacing non-printable characters.
The right-hand column is not updated properly, "printable" bytes are replaced by spaces, "non printable" bytes are replaced by dots. This is another problem, sounds like #3259.