emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Coding systems in Babel


From: Eric Schulte
Subject: Re: [Orgmode] Coding systems in Babel
Date: Mon, 13 Dec 2010 13:00:24 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

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
| é |

#+begin_src python :var t=toto :preamble # -*- coding: latin1 -*- :return 
[len(babel), len(local)]
  babel = unicode (t[0][0],"latin1")
  local = unicode ("é","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 <address@hidden> 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
> | é |
>
> #+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
>
> 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.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode



reply via email to

[Prev in Thread] Current Thread [Next in Thread]