From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: How to convert char from Emacs-20 internal to UTF-8? Date: Wed, 16 Mar 2005 12:19:33 -0500 Message-ID: <87acp3jyqi.fsf-monnier+emacs@gnu.org> References: <64cb038a0c479b993368280a127af987@cogsci.ucsd.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1110996028 31141 80.91.229.2 (16 Mar 2005 18:00:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 16 Mar 2005 18:00:28 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 16 19:00:27 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DBccY-00083C-0j for ged-emacs-devel@m.gmane.org; Wed, 16 Mar 2005 18:47:50 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DBcsf-0002cO-RK for ged-emacs-devel@m.gmane.org; Wed, 16 Mar 2005 13:04:29 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DBcmo-0000Pi-B6 for emacs-devel@gnu.org; Wed, 16 Mar 2005 12:58:26 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DBcml-0000OC-Lt for emacs-devel@gnu.org; Wed, 16 Mar 2005 12:58:25 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DBcmE-0008Hi-Nr for emacs-devel@gnu.org; Wed, 16 Mar 2005 12:57:50 -0500 Original-Received: from [209.226.175.93] (helo=tomts36-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DBcBG-00011E-VD for emacs-devel@gnu.org; Wed, 16 Mar 2005 12:19:39 -0500 Original-Received: from alfajor ([67.68.217.141]) by tomts36-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050316171938.JWZL1694.tomts36-srv.bellnexxia.net@alfajor>; Wed, 16 Mar 2005 12:19:38 -0500 Original-Received: by alfajor (Postfix, from userid 1000) id 65AB72FDED; Wed, 16 Mar 2005 12:19:33 -0500 (EST) Original-To: Adrian Robert In-Reply-To: <64cb038a0c479b993368280a127af987@cogsci.ucsd.edu> (Adrian Robert's message of "Wed, 16 Mar 2005 11:46:52 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: news.gmane.org gmane.emacs.devel:34641 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:34641 > I apologize for the "retro" question, but I was wondering if there was an > easy way to convert a character in the Emacs-20 internal 19-bit encoding > (from FAST_GLYPH_CHAR(glyph)) to UTF-8 (preferable) or straight Unicode. > I'd like to do it fully within C if possible, and it needs to be efficient. Since Emacs-21's internal chars are a superset of Emacs-20's internal chars, you can just use Emacs-21's facilities like (encode-coding-string 'utf-8) or (encode-char 'ucs). Stefan