Browse Source

Fix insertion of text from hex numbers

Using `insert` directly makes use of character conversion and may scramble the
byte when inserting into the buffer (indeed, `insert` does not seem to insert
the byte, but the characters whose code-points is given in the string; same for
`insert-char`).
master
Daniel Borchmann 8 months ago
parent
commit
e15be73bc1
No known key found for this signature in database
GPG Key ID: 1C7071A75BB72D64
  1. 3
      site-lisp/db-utils.el

3
site-lisp/db-utils.el

@ -181,7 +181,8 @@ the result in the minibuffer."
(if (use-region-p)
(progn
(delete-region (region-beginning) (region-end))
(insert result))
(dolist (char (string-to-list result))
(insert-byte char 1)))
(message result))))
(defun db/text-to-hex (text-string)

Loading…
Cancel
Save