all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* python-shell-send-region uses wrong encoding?
@ 2013-10-29 11:30 Ernest Adrogué
  2013-10-29 14:24 ` Drew Adams
                   ` (2 more replies)
  0 siblings, 3 replies; 28+ messages in thread
From: Ernest Adrogué @ 2013-10-29 11:30 UTC (permalink / raw)
  To: help-gnu-emacs

Hi there,

I have got a problem with python-shell-send-region. It seems to use a wrong
encoding. For example, I have this file:

$ cat /tmp/test.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import print_function

a = 'Wörterbuch'.decode('utf8')
b = u'Wörterbuch'

print(repr(a))
print(repr(b))
$ 

When I open the file with Emacs and do python-shell-send-buffer (C-c C-c by
default) the following lines appear in the shell buffer:

u'W\xf6rterbuch'
u'W\xf6rterbuch'

This is the same output that I get when I run the script in a terminal.
However, if I select the lines after 'from __future__ ...' until the end and
do python-shell-send-region (C-c C-r) I get this output instead:

u'W\xf6rterbuch'
u'W\xc3\xb6rterbuch'

The second line of output seems to indicate that the text was sent in a
different encoding compared to python-shell-send-buffer.

What is going on?

Regards.



^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2013-11-04 19:15 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-29 11:30 python-shell-send-region uses wrong encoding? Ernest Adrogué
2013-10-29 14:24 ` Drew Adams
2013-10-29 14:37   ` Ernest Adrogué
2013-10-29 16:00     ` Drew Adams
2013-10-29 16:54       ` Ernest Adrogué
2013-10-29 17:11       ` Eli Zaretskii
2013-10-29 14:26 ` Andreas Röhler
2013-10-29 14:55   ` Ernest Adrogué
2013-10-29 15:29     ` Andreas Röhler
2013-10-29 15:34     ` Peter Dyballa
2013-10-29 16:34       ` Ernest Adrogué
2013-10-29 17:15         ` Eli Zaretskii
2013-10-29 17:53           ` Ernest Adrogué
2013-10-29 19:10             ` Eli Zaretskii
2013-10-29 20:48               ` Ernest Adrogué
2013-10-29 18:07         ` Peter Dyballa
2013-10-29 20:37           ` Ernest Adrogué
2013-10-29 17:28 ` Stefan Monnier
2013-10-30  3:20   ` Stefan Monnier
2013-10-30  6:45     ` Andreas Röhler
2013-10-30 11:37       ` Stefan Monnier
2013-10-30 12:08         ` Yuri Khan
2013-10-30 12:45           ` Andreas Röhler
2013-10-31 14:30         ` Ernest Adrogué
2013-10-31 14:31     ` Ernest Adrogué
2013-10-31 17:54     ` Ernest Adrogué
2013-10-31 20:35       ` Stefan Monnier
2013-11-04 19:15       ` Stefan Monnier

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.