[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: editing binary (hexa) data
From: |
Peter Dyballa |
Subject: |
Re: editing binary (hexa) data |
Date: |
Thu, 17 May 2007 20:27:51 +0200 |
Am 17.05.2007 um 19:24 schrieb David Kastrup:
You mean
M-x replace-regexp RET . RET \,(string-to-char \1) RET
No, I meant that the text is first written in ASCII as "text" and
then converted to ASCII values separated by spaces, i.e. the numbers
and spaces we've seen.
(returns Emacs' internal coding, not unicode or latin-1).
So it is not converting "ASCII" characters to their values?
or such and back with
M-x replace-regexp RET \([1-9][0-9]\) RET \,(string (+ ?a \1)) RET
M-x replace-regexp RET [0-9]+ RET \,(string (+ ?a \#&)) RET
But why ?a? Weird.
You're right: this is nonsense! The numbers already *are* the ASCII
values (and not the first, second, third ... letter, and the smallest
letter is, of course, capital A!), so it's not necessary to add the
smallest letter's ASCII value to the supposed ordinal. And two digits
are not enough for all ASCII characters, since d already has 100 in
decimal!
Why are you using ``\#&´´? Isn't \# meaning the back-reference?
--
Mit friedvollen Grüßen
Pete
A child of five could understand this! Fetch me a child of five.