Ticket #3260 (closed defect: fixed)

Opened 10 years ago

Last modified 10 years ago

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

mc-3260-hex-utf8-input.patch (455 bytes) - added by egmont 10 years ago.
Fix

Change History

comment:1 Changed 10 years ago by egmont

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.

Changed 10 years ago by egmont

Fix

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

comment:7 Changed 10 years ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.