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`).
This commit is contained in:
parent
a8cfeaf69f
commit
e15be73bc1
|
@ -181,7 +181,8 @@ the result in the minibuffer."
|
||||||
(if (use-region-p)
|
(if (use-region-p)
|
||||||
(progn
|
(progn
|
||||||
(delete-region (region-beginning) (region-end))
|
(delete-region (region-beginning) (region-end))
|
||||||
(insert result))
|
(dolist (char (string-to-list result))
|
||||||
|
(insert-byte char 1)))
|
||||||
(message result))))
|
(message result))))
|
||||||
|
|
||||||
(defun db/text-to-hex (text-string)
|
(defun db/text-to-hex (text-string)
|
||||||
|
|
Loading…
Reference in New Issue