From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Roland Winkler" Newsgroups: gmane.emacs.devel Subject: Re: converting octal escape sequences to utf-8 and back Date: Sat, 28 May 2011 22:48:57 -0500 Message-ID: <19937.49705.729096.450819@gargle.gargle.HOWL> References: <19937.37639.583480.682350@gargle.gargle.HOWL> <8362oub48n.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1306644065 21854 80.91.229.12 (29 May 2011 04:41:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 29 May 2011 04:41:05 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 29 06:41:00 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QQXoC-0006pi-9y for ged-emacs-devel@m.gmane.org; Sun, 29 May 2011 06:41:00 +0200 Original-Received: from localhost ([::1]:40740 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQXoB-0005Of-AA for ged-emacs-devel@m.gmane.org; Sun, 29 May 2011 00:40:59 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:41193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQX03-0002xT-Tp for emacs-devel@gnu.org; Sat, 28 May 2011 23:49:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QQX03-000585-37 for emacs-devel@gnu.org; Sat, 28 May 2011 23:49:11 -0400 Original-Received: from tfkpsv.physik.uni-erlangen.de ([131.188.164.197]:3989) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQX01-00057s-QQ; Sat, 28 May 2011 23:49:09 -0400 Original-Received: from regnitz (unknown [202.20.0.151]) by tfkpsv.physik.uni-erlangen.de (Postfix) with ESMTP id 1B13321105; Sun, 29 May 2011 05:49:03 +0200 (CEST) In-Reply-To: <8362oub48n.fsf@gnu.org> X-Mailer: VM 8.2 trial under 23.3.1 (x86_64-unknown-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 131.188.164.197 X-Mailman-Approved-At: Sun, 29 May 2011 00:40:58 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:139865 Archived-At: On Sun May 29 2011 Eli Zaretskii wrote: > > Date: Sat, 28 May 2011 19:27:51 -0500 > > From: "Roland Winkler" > > I am trying to use emacs to interface with a program that treats > > utf-8 characters in its input and output as octal escape sequences.= > > So the program's output contains ascii strings like "\302\247", > > which I want to display within Emacs as "=A7". Likewise, I want to > > feed text containing utf-8 characters such as "=A7" into this progr= am. > > So I need to convert these utf-8 characters back to their respectiv= e > > octal escape sequences. What is the proper way to achieve this? >=20 > A new coding-system? I cannot claim I understand these things. But I thought that there was some kind of a "conversion formula" that allows one to calculate the octal sequence for any utf-8 character and also the opposite, get the character given the octal sequence. Is this true? There is a little tool uni2ascii which seems to implement this, see http://directory.fsf.org/project/uni2ascii/ But if possible I would like to achieve this from within Emacs. Roland