From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vincent Beffara Subject: Coding systems in Babel Date: Mon, 06 Dec 2010 18:13:37 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from [140.186.70.92] (port=51557 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPedX-0000LH-L6 for emacs-orgmode@gnu.org; Mon, 06 Dec 2010 12:14:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PPedW-00019j-G2 for emacs-orgmode@gnu.org; Mon, 06 Dec 2010 12:14:03 -0500 Received: from lo.gmane.org ([80.91.229.12]:33767) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PPedW-00019H-7r for emacs-orgmode@gnu.org; Mon, 06 Dec 2010 12:14:02 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PPedN-0001bB-IL for emacs-orgmode@gnu.org; Mon, 06 Dec 2010 18:13:53 +0100 Received: from 140.77.141.68 ([140.77.141.68]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 06 Dec 2010 18:13:53 +0100 Received: from vbeffara by 140.77.141.68 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 06 Dec 2010 18:13:53 +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: emacs-orgmode@gnu.org 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: --8<---------------cut here---------------start------------->8--- #+tblname: toto | é | #+begin_src python :var t=toto :preamble # -*- coding: latin1 -*- babel = unicode (t[0][0],"latin1") local = unicode ("é","latin1") return [len(babel), len(local)] #+end_src --8<---------------cut here---------------end--------------->8--- Evaluating the block with C-c C-c leads to this: --8<---------------cut here---------------start------------->8--- #+results: | 1 | 1 | --8<---------------cut here---------------end--------------->8--- 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