From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Coding systems in Babel Date: Mon, 13 Dec 2010 13:00:24 -0700 Message-ID: <87tyihh293.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=48786 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSEZV-0000zU-27 for emacs-orgmode@gnu.org; Mon, 13 Dec 2010 15:00:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSEZT-000085-8s for emacs-orgmode@gnu.org; Mon, 13 Dec 2010 15:00:32 -0500 Received: from mail-yx0-f169.google.com ([209.85.213.169]:59322) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PSEZT-00007p-5m for emacs-orgmode@gnu.org; Mon, 13 Dec 2010 15:00:31 -0500 Received: by yxl31 with SMTP id 31so4210460yxl.0 for ; Mon, 13 Dec 2010 12:00:30 -0800 (PST) In-Reply-To: (Vincent Beffara's message of "Mon, 06 Dec 2010 18:13:37 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Vincent Beffara Cc: emacs-orgmode@gnu.org Hi Vincent, This may be a by product of your local Emacs settings. I say this only because when I execute the same code block I get a different result, e.g. ** utf8 and latin-1 encodings #+tblname: toto | =C3=A9 | #+begin_src python :var t=3Dtoto :preamble # -*- coding: latin1 -*- :return= [len(babel), len(local)] babel =3D unicode (t[0][0],"latin1") local =3D unicode ("=C3=A9","latin1") #+end_src #+results: | 2 | 2 | I must profess I don't know what the python commands in your example code block are doing, and I'm not sure what the desired result is. Hope this is of some help-- Eric Vincent Beffara writes: > Hi, it's me again, still trying to make sense of the interaction between > Org, Babel and coding systems. I have, in a UTF8-encoded .org file, this > code block: > > #+tblname: toto > | =C3=A9 | > > #+begin_src python :var t=3Dtoto :preamble # -*- coding: latin1 -*- > babel =3D unicode (t[0][0],"latin1") > local =3D unicode ("=C3=A9","latin1") > return [len(babel), len(local)] > #+end_src > > Evaluating the block with C-c C-c leads to this: > > #+results: > | 1 | 1 | > > So, the instance of python spawned by C-c C-c receives the text as > latin-1 encoded. Somewhere a conversion from UTF8 to latin-1 > happens. But I don't want that, I want everything to stay in UTF8 from > the beginning to the end. I guess I have two questions: > > At what point in the process is the convertion performed ? > > How do I prevent it / how do I specify UTF8 as the exchange format > between Org-Babel and outside processes spawned by C-c C-c ? > > The whole point is to make executed code-blocks and tangled source code > behave the same way - in that particular case, tangling leads to a > UTF8-encoded file, which is what I expected to happen. > > Thanks for your help! > > /vincent > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode