Ticket #3006 (new enhancement)

Opened 7 years ago

Last modified 7 years ago

Unescape, reencode and insert string

Reported by: szaszg Owned by:
Priority: major Milestone: Future Releases
Component: mcedit Version: master
Keywords: Cc: gotar@…
Blocked By: Blocking:
Branch state: no branch Votes for changeset:


From time to time I face the fact that I can not insert a literal 0 byte (NUL) into the text. Furthermore extra characters are often difficult to add with the "Insert literal" function, often can only guess which key combination will produce the desired results.

So, this patch provide a new dialog to mceditor.
With this dialog we can insert escaped text that can be reencoded to the "display" codepage.
We can use C-style escapes (e.g.: \t, \027), HTML entities (e.g.: Ä or ·), URL-style escapes (e.g. %20 or %40), Hex-string (e.g. 4865782d) or DOS/Win Numpad-style escapes (e.g. ^32 or ^127). Of course, one at a time of them.
In most of them we can use unicode escapes (\uhhhh, &#ddddd or &#xhhhh, %uhhhh, and ^uhhhh).
We can specify the source encoding, and if it is different from display encoding it converts...
Not only typed text, but files can be inserted into, or you can unescape and reencode the marked block (selection).
Similar to the "Insert File" function, we can insert compressed files as well.

Currently, the key combination "ctrl-w" is assigned to this function, as well as a menu item in the "Format" menu ("Insert escaped string").

Could be a further development to not only be able to unescape text, but to do escape as well.


mc.insert_estring.diff (59.7 KB) - added by szaszg 7 years ago.

Change History

comment:1 Changed 7 years ago by gotar

  • Cc gotar@… added

Changed 7 years ago by szaszg

comment:2 Changed 7 years ago by szaszg

Patch updated

Note: See TracTickets for help on using tickets.