From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.devel Subject: Re: converting octal escape sequences to utf-8 and back Date: Sun, 29 May 2011 10:57:20 +0800 Message-ID: References: <19937.37639.583480.682350@gargle.gargle.HOWL> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1306637867 30510 80.91.229.12 (29 May 2011 02:57:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 29 May 2011 02:57:47 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 29 04:57:44 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 1QQWCD-0007yk-PE for ged-emacs-devel@m.gmane.org; Sun, 29 May 2011 04:57:41 +0200 Original-Received: from localhost ([::1]:46736 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQWCD-0000In-DQ for ged-emacs-devel@m.gmane.org; Sat, 28 May 2011 22:57:41 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:46455) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQWCB-0000Ii-8o for emacs-devel@gnu.org; Sat, 28 May 2011 22:57:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QQWCA-0007Wi-GO for emacs-devel@gnu.org; Sat, 28 May 2011 22:57:39 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:54182) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QQWCA-0007We-AI for emacs-devel@gnu.org; Sat, 28 May 2011 22:57:38 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QQWC5-0007xA-LU for emacs-devel@gnu.org; Sun, 29 May 2011 04:57:34 +0200 Original-Received: from th041091.ip.tsinghua.edu.cn ([59.66.41.91]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 29 May 2011 04:57:33 +0200 Original-Received: from sdl.web by th041091.ip.tsinghua.edu.cn with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 29 May 2011 04:57:33 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 19 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: th041091.ip.tsinghua.edu.cn Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAGFBMVEUKDAg1NjRWV1V9fnyg op/DxcLk5uP8/voi63ReAAAACXBIWXMAAAWJAAAFiQFtaJ36AAAAB3RJTUUH1goZAgAz00bgXgAA AeVJREFUKM9lk0Fz2jAQhQXJD3CCO70CmcC1YMtcWyTZ14Bl69xats4N9r6/3zWQBlodNKNPu/s0 b1cCQFuZGpfVVh3vAvBJolIXRkapSuoRUtIdFyo1Y5xSdlAj7OtvD1XnXxmWRi+eWgcxyCed1lVV B1CrKyujMoi+eLA5kU1SsjoHlW+nQjTtFxk4MXgrOxvIqzoTZR8XgPaLl419zgsMaSGFPiUOZCIh thsx5Xy9NsK8Kwf/JoQgMxcVJ301HKkcSWaT0O7FY056J4U9xcYfnmVXG4801lW6lqwu2nKFZoHC HuzvaTVndZ+LaRQgZdthXw1cpynEkLEwyFHXk/aIxNQ6QeooJuzPMB+wn+D7JJNsiCcVA13/A3h/ xE9J+WidpAwoYNmRFwyvSRhNVtsdaAewzZZP5uw82QL9+tyNfocyP0McAzICUr5Mk9RdIjWasUNx aIIt6NK4ZtXIMdfMQt3nuMAyWbLI4DqZ4xPq/ag8jPond4XU/cLuOgw6XCFX/YCUfcDAMMH58fD4 G9kDchwfqVefkBwup2uZM+Q4WhJt5jN3AxXCsaS2yXEDuWgS8VOzW0gFjhEPmLyFMKBFaLb1HRwc DiaKwx0EeTMRYnYPQRW3PP4HApvlMv0PttX5v/D6Aws3IOSEwzmLAAAAAElFTkSuQmCC User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3.50 (Mac OS X 10.6.7) Cancel-Lock: sha1:yszOz6oTfy9u7JW2fpeC43J6kXA= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 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:139862 Archived-At: On 2011-05-29 08:27 +0800, Roland Winkler wrote: > 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? > > Thanks a lot, > > Roland Are these functions useful? encode-coding-string, decode-coding-string encode-coding-region, decode-coding-region Leo