Re: [O] babel evaluation of python and utf-8
El Fri, 04 Jul 2014 16:08:10 +0200 Alan Schmitt va escriure: On 2014-06-26 18:07, Daniel Clemente n142...@gmail.com writes: #+BEGIN_SRC python :prefix # -*- coding: utf-8 -*- :results output print(u'é') #+END_SRC I also see the same problem here. Even if you include # -*- coding: utf-8 -*-as the first line. Shouldn't org-babel already be using utf-8 instead of ASCII for input/output? By the way, with Python3 it doesn't happen since it doesn't need the coding:utf-8 declaration anymore. Should this be considered a bug, or do we require python 3 for such things? I think if the user writes the # -*- coding: utf-8 -*- line, org-mode should pass it. With that, all Pythons (Python2, Python3) work well, so I wouldn't say there's a bug in Python. It would be in org-mode.
Re: [O] babel evaluation of python and utf-8
On 2014-06-26 18:07, Daniel Clemente n142...@gmail.com writes: #+BEGIN_SRC python :prefix # -*- coding: utf-8 -*- :results output print(u'é') #+END_SRC I also see the same problem here. Even if you include # -*- coding: utf-8 -*-as the first line. Shouldn't org-babel already be using utf-8 instead of ASCII for input/output? By the way, with Python3 it doesn't happen since it doesn't need the coding:utf-8 declaration anymore. Should this be considered a bug, or do we require python 3 for such things? Thanks, Alan -- OpenPGP Key ID : 040D0A3B4ED2E5C7 pgpI513c3HbyQ.pgp Description: PGP signature
[O] babel evaluation of python and utf-8
Hello, I'm having trouble with the babel evaluation of python blocks containing utf-8 encoded characters (which is the encoding of my org file). I tried the approach suggested in this message https://lists.gnu.org/archive/html/emacs-orgmode/2010-12/msg00086.html in the following block #+BEGIN_SRC python :prefix # -*- coding: utf-8 -*- :results output print(u'∀') #+END_SRC but when I evaluate it, I get an error File stdin, line 1 SyntaxError: Non-ASCII character '\xe2' in file stdin on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details Am I doing something wrong? Thanks, Alan -- OpenPGP Key ID : 040D0A3B4ED2E5C7 pgpRqVumhA7nU.pgp Description: PGP signature
Re: [O] babel evaluation of python and utf-8
On 2014-06-26 09:35, Alan Schmitt alan.schm...@polytechnique.org writes: #+BEGIN_SRC python :prefix # -*- coding: utf-8 -*- :results output print(u'∀') #+END_SRC I see that somewhere the email did not get through, the character above is a forall character. I have the same problem with a simpler accent #+BEGIN_SRC python :prefix # -*- coding: utf-8 -*- :results output print(u'é') #+END_SRC Alan -- OpenPGP Key ID : 040D0A3B4ED2E5C7 pgp2KIZ_YP4vY.pgp Description: PGP signature
Re: [O] babel evaluation of python and utf-8
#+BEGIN_SRC python :prefix # -*- coding: utf-8 -*- :results output print(u'é') #+END_SRC I also see the same problem here. Even if you include # -*- coding: utf-8 -*- as the first line. Shouldn't org-babel already be using utf-8 instead of ASCII for input/output? By the way, with Python3 it doesn't happen since it doesn't need the coding:utf-8 declaration anymore.