emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Vincent Beffara <vbeffara@ens-lyon.fr>
To: emacs-orgmode@gnu.org
Subject: Coding systems in Babel
Date: Mon, 06 Dec 2010 18:13:37 +0100	[thread overview]
Message-ID: <m2ipz6lt8e.fsf@ens-lyon.fr> (raw)


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

             reply	other threads:[~2010-12-06 17:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-06 17:13 Vincent Beffara [this message]
2010-12-07 13:24 ` Coding systems in Babel Vincent Beffara
2010-12-13 20:00 ` Eric Schulte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2ipz6lt8e.fsf@ens-lyon.fr \
    --to=vbeffara@ens-lyon.fr \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).