From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vincent Beffara Subject: Re: Coding systems in Babel Date: Tue, 07 Dec 2010 14:24:48 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=60079 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPxXh-0008IY-Ks for emacs-orgmode@gnu.org; Tue, 07 Dec 2010 08:25:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PPxXf-0007wA-BA for emacs-orgmode@gnu.org; Tue, 07 Dec 2010 08:25:17 -0500 Received: from lo.gmane.org ([80.91.229.12]:57092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PPxXf-0007vq-19 for emacs-orgmode@gnu.org; Tue, 07 Dec 2010 08:25:15 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PPxXb-0006cq-3u for emacs-orgmode@gnu.org; Tue, 07 Dec 2010 14:25:11 +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 ; Tue, 07 Dec 2010 14:25:11 +0100 Received: from vbeffara by 140.77.141.68 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 07 Dec 2010 14:25:11 +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 Hello, > 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 ? Mmmmkay, answering to myself (you never know, maybe it will be useful to someone else later ...): the answer to that is in the general interprocess comunication in Emacs. I ended up doing this: --8<---------------cut here---------------start------------->8--- (setq default-process-coding-system '(utf-8-unix . utf-8-unix)) --8<---------------cut here---------------end--------------->8--- and everything works fine now. Having to set this by hand is a bit counter-intuitive though - would it make sense to have babel set =coding-system-for-read= and =coding-system-for-write= when running a subprocess ? From what I understand, =shell-command-on-region= does that automatically but =org-babel-eval= uses a temporary buffer which loses the encoding choice for the .org file buffer. Sorry for the noise, and thanks to all for this excellent tool ! I am getting addicted to org and babel by the minute ... Cheers, /v