From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Re: How to translate LaTeX into UTF-8 in Elisp? Date: Mon, 03 Jul 2017 06:56:36 +0200 Message-ID: <87bmp2rud7.fsf@jane> References: <87shpyfj2q.fsf@mbork.pl> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1499057838 31079 195.159.176.226 (3 Jul 2017 04:57:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 3 Jul 2017 04:57:18 +0000 (UTC) User-Agent: mu4e 0.9.19; emacs 26.0.50 To: Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 03 06:57:14 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dRtQ9-0007mI-Qw for geh-help-gnu-emacs@m.gmane.org; Mon, 03 Jul 2017 06:57:13 +0200 Original-Received: from localhost ([::1]:60342 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRtQD-0005kI-F5 for geh-help-gnu-emacs@m.gmane.org; Mon, 03 Jul 2017 00:57:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRtPo-0005kA-9S for help-gnu-emacs@gnu.org; Mon, 03 Jul 2017 00:56:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dRtPk-0002vX-Cu for help-gnu-emacs@gnu.org; Mon, 03 Jul 2017 00:56:52 -0400 Original-Received: from mail.mojserwer.eu ([195.110.48.8]:37582) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRtPk-0002uV-5m for help-gnu-emacs@gnu.org; Mon, 03 Jul 2017 00:56:48 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 420DDE640F for ; Mon, 3 Jul 2017 06:56:47 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gAZUSEmZEi9L for ; Mon, 3 Jul 2017 06:56:44 +0200 (CEST) Original-Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 3FABFE6224 for ; Mon, 3 Jul 2017 06:56:44 +0200 (CEST) In-reply-to: <87shpyfj2q.fsf@mbork.pl> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.110.48.8 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:113659 Archived-At: On 2016-12-08, at 18:04, Marcin Borkowski wrote: > Hi all, > > I have a string with embedded sequences like "\'e" or "\H{o}". The > Emacs TeX input method knows how to convert them into "=C3=A9" or "=C5=91= " (when > typing, of course). Is there a way to use that to perform similar > conversions in a string? Hi all, I'm revisiting this old thread now. Since I got no satisfying answers back then, here is my plan for solution. I'm going first to map \', \` etc. onto /names/ (this is a rather short list!), construct a Unicode name of the character I want and then use =3Ducs-names=3D. For instance, \' maps to "ACUTE", then \'a will map to "LATIN SMALL LETTER A ACUTE" and this can be fed into =3Dchar-from-name=3D. It is a horrible hack, but it should work. Any better ideas? Best, -- Marcin Borkowski