From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: python-shell-send-region uses wrong encoding? Date: Tue, 29 Oct 2013 19:15:03 +0200 Message-ID: <83ppqodmnc.fsf@gnu.org> References: <20131029113044.GA28039@doriath.local> <526FC58A.6080204@easy-emacs.de> <20131029145554.GB28671@doriath.local> <20131029163426.GA29055@doriath.local> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: ger.gmane.org 1383066924 15897 80.91.229.3 (29 Oct 2013 17:15:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Oct 2013 17:15:24 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Oct 29 18:15:28 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VbCt6-0008Je-Op for geh-help-gnu-emacs@m.gmane.org; Tue, 29 Oct 2013 18:15:28 +0100 Original-Received: from localhost ([::1]:48506 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbCt6-0005E8-Bh for geh-help-gnu-emacs@m.gmane.org; Tue, 29 Oct 2013 13:15:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbCsn-0005Br-Pw for help-gnu-emacs@gnu.org; Tue, 29 Oct 2013 13:15:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VbCsg-0008Vt-Gv for help-gnu-emacs@gnu.org; Tue, 29 Oct 2013 13:15:09 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:62400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbCsg-0008Pj-9Y for help-gnu-emacs@gnu.org; Tue, 29 Oct 2013 13:15:02 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MVF00000X1G2Q00@a-mtaout20.012.net.il> for help-gnu-emacs@gnu.org; Tue, 29 Oct 2013 19:15:01 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MVF00NFDX904V50@a-mtaout20.012.net.il> for help-gnu-emacs@gnu.org; Tue, 29 Oct 2013 19:15:01 +0200 (IST) In-reply-to: <20131029163426.GA29055@doriath.local> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.166 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:94254 Archived-At: > Date: Tue, 29 Oct 2013 17:34:26 +0100 > From: Ernest Adrogu=C3=A9 >=20 > The "=C3=B6" character is stored in the file as 0xC3 0xB6. As you s= ay, this is > the UTF-8 encoding for this character. >=20 > The Python interpreter interprets the 2-byte sequence correctly. T= his 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 conver= ted into > 0xF6, which is the UTF-16 encoding for "=C3=B6" that Python uses in= ternally, as > the output from repr() shows.. >=20 > 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-regio= n. Why is that a bug, and what would you expect python-shell-send-region to send instead (and why)?