From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eduardo Ochs Newsgroups: gmane.emacs.help Subject: Re: Convert the hexadecimal character code to the corresponding Unicode value. Date: Sat, 2 Oct 2021 03:20:00 -0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30652"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs To: Hongyi Zhao Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 02 08:20:50 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mWYOA-0007me-D6 for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 02 Oct 2021 08:20:50 +0200 Original-Received: from localhost ([::1]:36130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWYO9-0002wY-Dj for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 02 Oct 2021 02:20:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWYNd-0002wQ-9a for help-gnu-emacs@gnu.org; Sat, 02 Oct 2021 02:20:17 -0400 Original-Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:42640) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWYNa-0004NC-FS for help-gnu-emacs@gnu.org; Sat, 02 Oct 2021 02:20:17 -0400 Original-Received: by mail-pf1-x436.google.com with SMTP id q23so9838181pfs.9 for ; Fri, 01 Oct 2021 23:20:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TVXX0tA8qptF2QrvwUN+corusKm288kqRrjFV+speDI=; b=Moz7pB/RZIf1AvNbBfJ8MLf2v1irbW6LUeAhNBTLLdeCeXY6pS4wWcS7Rj69Uh58G3 nUlVEFi8QswIlaHF2zMbtkF2ASvmRNFrDbViV3ZTRLBb3OMSZPS5cLyn6bu3kfrBraNY VhDpeofSCEIRZ8kxsnpQ1S9vjqO0knS2l/pm0AaivNImyRxadTTVg69KV54/Dde1WbEv L2ANrZi3ECt2DFr+lkU/xGG7F+0+M668SlKySxRcXEBX8b2CznYnE67VKqm0HkmiB85w vfwTRE3G/9dXjsf6OOmvZq0ZQvYgMkmncXaGUxsJe8L8kAqjk+hvo6PbvJaXexDFaS4S +FCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TVXX0tA8qptF2QrvwUN+corusKm288kqRrjFV+speDI=; b=IuAr4HqroO6VnAEPdR2SzLQhuzuZdCwhZ6YOHQPazZvPnP7VXMyouKjbnREW5WP+PR QBEPGG+bH0ugZrZQCy/EdD6dIff55iDLdnzbikWn7RoLWxs1ec7njxrs7oGa55bEXYxE PBkeFLmwqHY71F02demjGJF4dSkAUPhbKvCVprxab4pZU3sLF6/n0yqWhvRSmdZIN750 E9NmGfWoOLaEhc4veVSUGbraM4cchPTUDnfbx+rfQXaw5ix5y0xdDsYNVRMdLCWJowUv AGNjCX6JO/piU73di23WQOEO2fqbJfPWd/flSjhT8UoUwJhWFYQ7pNA/GHNeSY+os7Np lr8g== X-Gm-Message-State: AOAM533IrhTNf9MZ2oh9JOXjCAew5Fi2BsEXa7CMr63MDK0qkVmS9TjD RZlqkhaK+cnTZvfRSgndrgMAugIMrGhGYteeDgI= X-Google-Smtp-Source: ABdhPJw7UlDRhCdYVj2lo7BTa93X18vKBkP9uianfhzBD8rz4PNOcAkojE0GmKtO4W9uHaTbq/rnEIrmlHQcPwYovBU= X-Received: by 2002:a63:1e60:: with SMTP id p32mr1741302pgm.234.1633155612088; Fri, 01 Oct 2021 23:20:12 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=eduardoochs@gmail.com; helo=mail-pf1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:133496 Archived-At: Hi Hongyi, does this help? (string-to-number "1D4E0" 16) (char-to-string (string-to-number "1D4E0" 16)) (string (string-to-number "1D4E0" 16)) (format "%c" (string-to-number "1D4E0" 16)) (insert (string-to-number "1D4E0" 16)) The entry for 1D4E0 in UnicodeData.txt is: 1D4E0;MATHEMATICAL BOLD SCRIPT CAPITAL Q;Lu;0;L; 0051;;;;N;;;;; I have some hacks to display the characters around a certain entry in UnicodeData.txt here, http://angg.twu.net/.emacs.html#find-echars-around (find-wgeta-elisp "http://angg.twu.net/.emacs" "find-echars-around") but the code is ugly - I wrote it in a hurry ages ago and never cleaned the code up... Cheers, Eduardo Ochs http://angg.twu.net/#eev On Fri, 1 Oct 2021 at 07:28, Hongyi Zhao wrote: > > I noticed some comments on the escape syntax used by Emacs from here > [1-2]. By default, the `describe-char' command will give the code > point representation of the character in hexadecimal and octal > formats, say, #o240, #xa0. So, I want to if there is a convenient way > to do the conversion between the hexadecimal character code > representation and the corresponding Unicode value. > > [1] http://ergoemacs.org/emacs/elisp_unicode_representation_in_string.html > [2] (info "(elisp) General Escape Syntax") > > Regards, HZ >