Re: converting octal escape sequences to utf-8 and back

From:

Roland Winkler

Subject:

Re: converting octal escape sequences to utf-8 and back

Date:

Sat, 28 May 2011 22:48:57 -0500

On Sun May 29 2011 Eli Zaretskii wrote:
> > Date: Sat, 28 May 2011 19:27:51 -0500
> > From: "Roland Winkler" <address@hidden>
> > 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 "§". Likewise, I want to
> > feed text containing utf-8 characters such as "§" into this program.
> > So I need to convert these utf-8 characters back to their respective
> > octal escape sequences. What is the proper way to achieve this?
>
> 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