[Top][All Lists]

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

Re: python-shell-send-region uses wrong encoding?

From: Ernest Adrogué
Subject: Re: python-shell-send-region uses wrong encoding?
Date: Tue, 29 Oct 2013 18:53:03 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

29-10-2013, 19:15 (+0200); Eli Zaretskii escriu:
> > Date: Tue, 29 Oct 2013 17:34:26 +0100
> > From: Ernest Adrogué <address@hidden>
> > 
> > The "ö" character is stored in the file as 0xC3 0xB6. As you say, this is
> > the UTF-8 encoding for this character.
> > 
> > The Python interpreter interprets the 2-byte sequence correctly.  This can
> > be seen in a number of ways: if I run the script in a terminal, or if I
> > paste or yank the line into Python shell buffer, or I do
> > python-shell-send-buffer, in all these cases the sequence is converted into
> > 0xF6, which is the UTF-16 encoding for "ö" that Python uses internally, as
> > the output from repr() shows..
> > 
> > However, when the bytes are sent with python-shell-send-region, the
> > interpeter thinks that 0xC3 0xB6 are 2 characters, which is wrong.  In light
> > of this, I would say that there is a bug in python-shell-send-region.
> Why is that a bug, and what would you expect python-shell-send-region
> to send instead (and why)?

I would expect python-shell-send-region to be a shortcut for saving the
region, switching to the shell buffer, yanking and hitting RET.

reply via email to

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