From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.help Subject: Re: Converting strings of hexadecimal numbers to the respective bytes Date: Tue, 7 Apr 2009 00:54:16 +0200 Message-ID: References: <4e8b531d-ecc7-4b71-ac69-faa82eccd4ae@c9g2000yqm.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1239058514 10547 80.91.229.12 (6 Apr 2009 22:55:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 6 Apr 2009 22:55:14 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: florian Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 07 00:56:33 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Lqxjz-00059O-8i for geh-help-gnu-emacs@m.gmane.org; Tue, 07 Apr 2009 00:56:31 +0200 Original-Received: from localhost ([127.0.0.1]:48225 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lqxib-0001qs-5M for geh-help-gnu-emacs@m.gmane.org; Mon, 06 Apr 2009 18:55:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LqxiE-0001qQ-S2 for help-gnu-emacs@gnu.org; Mon, 06 Apr 2009 18:54:43 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LqxiA-0001nI-9c for help-gnu-emacs@gnu.org; Mon, 06 Apr 2009 18:54:42 -0400 Original-Received: from [199.232.76.173] (port=33664 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LqxiA-0001nF-4X for help-gnu-emacs@gnu.org; Mon, 06 Apr 2009 18:54:38 -0400 Original-Received: from mail-bw0-f167.google.com ([209.85.218.167]:49710) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lqxi9-0006ZF-Lp for help-gnu-emacs@gnu.org; Mon, 06 Apr 2009 18:54:37 -0400 Original-Received: by bwz11 with SMTP id 11so2330464bwz.42 for ; Mon, 06 Apr 2009 15:54:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :received:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=rV6HHU4n0bxgc7abbf2+zIKKxgeFeUKGBbGr72LiuQM=; b=BWVWz4CxNgQVCRFuYippbocwKP054TFpPkTA9feTOWEIQkCgcWUslgS7s+hioFPkd4 zAjTlILhsVC9L7PkU1r/tMf8e1Vcjwl7fWXosQJExPe8Khoopio8dcdiByrNcFemJubZ 9zzaKsh0DcW/7Yg+bop7sUp25g6Qy01T9HUjY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=DeQ5J9VYsDHqzJX6QwS8DHkcnpKHkn9mr4MY0WMRIzmxow7c8rfqRHBKvRqCF9l3Jf B3TpNlcrxB5LMUEyuwDhG1FWsnOvVZ1lcMzKtUxPPusd396Nqx+DjDNDSZVg3IcKF6kt pY7R4mSF6uR25Hc3nmZhWb9K1sgmW7xIdLQeU= In-Reply-To: <4e8b531d-ecc7-4b71-ac69-faa82eccd4ae@c9g2000yqm.googlegroups.com> Original-Received: by 10.223.108.15 with SMTP id d15mr4009393fap.62.1239058473374; Mon, 06 Apr 2009 15:54:33 -0700 (PDT) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:63525 Archived-At: On Tue, Apr 7, 2009 at 00:22, florian wrote: > What I mean is: if it were a three-digit decimal representation, you > could say > > =C2=A0 (char-to-string (string-to-number "010")) > > instead, but I don't seem to see such a possibility for a hexadecimal > number. (string-to-number string &optional base) Parse string as a decimal number and return the number. This parses both integers and floating point numbers. It ignores leading spaces and tabs. If base, interpret string as a number in that base. If base isn't present, base 10 is used. base must be between 2 and 16 (inclusive). If the base used is not 10, floating point is not recognized. so (char-to-string (string-to-number "0a" 16)) =3D> "\n" Juanma