help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Is X'ABCD' notation of general interest? (was: Converting strings of hex


From: florian
Subject: Is X'ABCD' notation of general interest? (was: Converting strings of hexadecimal numbers to the respective bytes)
Date: Thu, 9 Apr 2009 03:05:03 -0700 (PDT)
User-agent: G2/1.0

Juanma,

>   (string-to-number string &optional base)

many thanks. I swear I did RTFM, or rather rummage it, but I obviously
missed that important bit.

Your hint was just what I lacked, and I used it to program two small
functions for converting strings in X'ABCD' notation into their binary
form and vice versa, along with two functions to do the same with file
contents (i.e. file contents to X'ABCD' and vice versa).

The X'ABCD' notation represents arbitrary bytes as their two-digit
hexadecimal representation, which produces strings that have double
the size and can be passed over the command line (SQLite uses this).
Does anybody think that functions to handle that (I have round-trip
tested them) would be of general interest, so that posting them on
gnu.emacs.sources would make sense? (Just don't want to clutter public
space needlessly.)

Many thanks again, and best regards,

Florian


reply via email to

[Prev in Thread] Current Thread [Next in Thread]